+ All Categories
Home > Documents > An Empirical Study of Machine Learning Algorithms for...

An Empirical Study of Machine Learning Algorithms for...

Date post: 14-Mar-2020
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
31
Research Article An Empirical Study of Machine Learning Algorithms for Stock Daily Trading Strategy Dongdong Lv , 1 Shuhan Yuan, 2 Meizi Li, 1,3 and Yang Xiang 1 1 College of Electronics and Information Engineering, Tongji University, Shanghai 201804, China 2 University of Arkansas, Fayetteville, AR 72701, USA 3 College of Information, Mechanical and Electrical Engineering, Shanghai Normal University, Shanghai 200234, China Correspondence should be addressed to Yang Xiang; [email protected] Received 17 October 2018; Revised 3 March 2019; Accepted 19 March 2019; Published 14 April 2019 Academic Editor: Kemal Polat Copyright © 2019 Dongdong Lv et al. is is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. According to the forecast of stock price trends, investors trade stocks. In recent years, many researchers focus on adopting machine learning (ML) algorithms to predict stock price trends. However, their studies were carried out on small stock datasets with limited features, short backtesting period, and no consideration of transaction cost. And their experimental results lack statistical significance test. In this paper, on large-scale stock datasets, we synthetically evaluate various ML algorithms and observe the daily trading performance of stocks under transaction cost and no transaction cost. Particularly, we use two large datasets of 424 S&P 500 index component stocks (SPICS) and 185 CSI 300 index component stocks (CSICS) from 2010 to 2017 and compare six traditional ML algorithms and six advanced deep neural network (DNN) models on these two datasets, respectively. e experimental results demonstrate that traditional ML algorithms have a better performance in most of the directional evaluation indicators. Unexpectedly, the performance of some traditional ML algorithms is not much worse than that of the best DNN models without considering the transaction cost. Moreover, the trading performance of all ML algorithms is sensitive to the changes of transaction cost. Compared with the traditional ML algorithms, DNN models have better performance considering transaction cost. Meanwhile, the impact of transparent transaction cost and implicit transaction cost on trading performance are different. Our conclusions are significant to choose the best algorithm for stock trading in different markets. 1. Introduction e stock market plays a very important role in modern economic and social life. Investors want to maintain or increase the value of their assets by investing in the stock of the listed company with higher expected earnings. As a listed company, issuing stocks is an important tool to raise funds from the public and expand the scale of the industry. In general, investors make stock investment decisions by predicting the future direction of stocks’ ups and downs. In modern financial market, successful investors are good at making use of high-quality information to make investment decisions, and, more importantly, they can make quick and effective decisions based on the information they have already had. erefore, the field of stock investment attracts the attention not only of financial practitioner and ordinary investors but also of researchers in academic [1]. In the past many years, researchers mainly constructed statistical models to describe the time series of stock price and trading volume to forecast the trends of future stock returns [2–4]. It is worth noting that the intelligent computing meth- ods represented by ML algorithms also present a vigorous development momentum in stock market prediction with the development of artificial intelligence technology. e main reasons are as follows. (1) Multisource heterogeneous financial data are easy to obtain, including high-frequency trading data, rich and diverse technical indicators data, macroeconomic data, industry policy and regulation data, market news, and even social network data. (2) e research of intelligent algorithms has been deepened. From the early linear model, support vector machine, and shallow neural network to DNN models and reinforcement learning algo- rithms, intelligent computing methods have made significant improvement. ey have been effectively applied to the fields Hindawi Mathematical Problems in Engineering Volume 2019, Article ID 7816154, 30 pages https://doi.org/10.1155/2019/7816154
Transcript
Page 1: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

Research ArticleAn Empirical Study of Machine Learning Algorithms forStock Daily Trading Strategy

Dongdong Lv 1 Shuhan Yuan2 Meizi Li13 and Yang Xiang 1

1College of Electronics and Information Engineering Tongji University Shanghai 201804 China2University of Arkansas Fayetteville AR 72701 USA3College of Information Mechanical and Electrical Engineering Shanghai Normal University Shanghai 200234 China

Correspondence should be addressed to Yang Xiang shxiangyangtongjieducn

Received 17 October 2018 Revised 3 March 2019 Accepted 19 March 2019 Published 14 April 2019

Academic Editor Kemal Polat

Copyright copy 2019 Dongdong Lv et al This is an open access article distributed under the Creative Commons Attribution Licensewhich permits unrestricted use distribution and reproduction in any medium provided the original work is properly cited

According to the forecast of stock price trends investors trade stocks In recent years many researchers focus on adopting machinelearning (ML) algorithms to predict stock price trends However their studies were carried out on small stock datasets withlimited features short backtesting period and no consideration of transaction cost And their experimental results lack statisticalsignificance test In this paper on large-scale stock datasets we synthetically evaluate various ML algorithms and observe thedaily trading performance of stocks under transaction cost and no transaction cost Particularly we use two large datasets of 424SampP 500 index component stocks (SPICS) and 185 CSI 300 index component stocks (CSICS) from 2010 to 2017 and comparesix traditional ML algorithms and six advanced deep neural network (DNN) models on these two datasets respectively Theexperimental results demonstrate that traditional ML algorithms have a better performance in most of the directional evaluationindicators Unexpectedly the performance of some traditional ML algorithms is not muchworse than that of the best DNNmodelswithout considering the transaction cost Moreover the trading performance of all ML algorithms is sensitive to the changes oftransaction cost Compared with the traditional ML algorithms DNN models have better performance considering transactioncost Meanwhile the impact of transparent transaction cost and implicit transaction cost on trading performance are different Ourconclusions are significant to choose the best algorithm for stock trading in different markets

1 Introduction

The stock market plays a very important role in moderneconomic and social life Investors want to maintain orincrease the value of their assets by investing in the stockof the listed company with higher expected earnings As alisted company issuing stocks is an important tool to raisefunds from the public and expand the scale of the industryIn general investors make stock investment decisions bypredicting the future direction of stocksrsquo ups and downs Inmodern financial market successful investors are good atmaking use of high-quality information to make investmentdecisions and more importantly they can make quick andeffective decisions based on the information they have alreadyhad Therefore the field of stock investment attracts theattention not only of financial practitioner and ordinaryinvestors but also of researchers in academic [1]

In the past many years researchers mainly constructedstatisticalmodels to describe the time series of stock price andtrading volume to forecast the trends of future stock returns[2ndash4] It is worth noting that the intelligent computing meth-ods represented by ML algorithms also present a vigorousdevelopment momentum in stock market prediction withthe development of artificial intelligence technology Themain reasons are as follows (1) Multisource heterogeneousfinancial data are easy to obtain including high-frequencytrading data rich and diverse technical indicators datamacroeconomic data industry policy and regulation datamarket news and even social network data (2) The researchof intelligent algorithms has been deepened From the earlylinear model support vector machine and shallow neuralnetwork to DNN models and reinforcement learning algo-rithms intelligent computing methods have made significantimprovement They have been effectively applied to the fields

HindawiMathematical Problems in EngineeringVolume 2019 Article ID 7816154 30 pageshttpsdoiorg10115520197816154

2 Mathematical Problems in Engineering

of image recognition and text analysis In some papers theauthors think that these advanced algorithms can capture thedynamic changes of the financial market simulate the tradingprocess of stock and make automatic investment decisions(3) The rapid development of high-performance computinghardware such as Graphics Processing Units (GPUs) largeservers and other devices can provide powerful storagespace and computing power for the use of financial big dataHigh-performance computer equipment accurate and fastintelligent algorithms and financial big data together canprovide decision-making support for programmed and auto-mated trading of stocks which has gradually been acceptedby industry practitioners Therefore the power of financialtechnology is reshaping the financial market and changingthe format of finance

Over the years traditional ML methods have shownstrong ability in trend prediction of stock prices [2ndash16]In recent years artificial intelligence computing methodsrepresented by DNN have made a series of major break-throughs in the fields of Natural Language Processing imageclassification voice translation and so on It is noteworthythat some DNN algorithms have been applied for time seriesprediction and quantitative trading [17ndash34] However mostof the previous studies focused on the prediction of thestock index of major economies in the world ([2 8 11 1315ndash17 22 29 30 32] etc) or selecting a few stocks withlimited features according to their own preferences ([8ndash11 1417 20 22 26 31] etc) or not considering transaction cost([10 14 17 23] etc) or the period of backtesting is veryshort ([2 8 9 11 17 20 22 27] etc) Meanwhile there isno statistical significance test between different algorithmswhich were used in stock trading ([8ndash11 32] etc)That is thecomparison and evaluation of the various trading algorithmslack large-scale stocks datasets considering transaction costand statistical significance testTherefore the performance ofbacktesting may tend to be overly optimistic In this regardwe need to clarify two concerns based on a large-scale stockdataset (1) whether the trading strategies based on the DNNmodels can achieve statistically significant results comparedwith the traditional ML algorithms without transaction cost(2) how do transaction costs affect trading performanceof the ML algorithm These problems constitute the mainmotivation of this research and they are very importantfor quantitative investment practitioners and portfolio man-agersThese solutions of these problems are of great value forpractitioners to do stock trading

In this paper we select 424 SPICS and 185 CSICS from2010 to 2017 as research objects The SPICS and CSICSrepresent the industry development of the worldrsquos top twoeconomies and are attractive to investors around the worldThe stock symbols are shown in the ldquoData Availabilityrdquo Foreach stock in SPICS and CSICS we construct 44 technicalindicators as shown in the ldquoData Availabilityrdquo The labelon the 119879-th trading day is the symbol for the yield ofthe 119879 + 1-th trading day relative to the 119879-th trading dayThat is if the yield is positive the label value is set to 1otherwise 0 For each stock we choose 44 technical indicatorsof 2000 trading days before December 31 2017 to builda stock dataset After the dataset of a stock is built we

choose the walk-forward analysis (WFA) method to trainthe ML models step by step In each step of training weuse 6 traditional ML methods which are support vectormachine (SVM) random forest (RF) logistic regression (LR)naıve Bayes model (NB) classification and regression tree(CART) and eXtreme Gradient Boosting algorithm (XGB)and 6 DNN models which are widely in the field of textanalysis and voice translation such as Multilayer Perceptron(MLP) Deep Belief Network (DBN) Stacked Autoencoders(SAE) Recurrent Neural Network (RNN) Long Short-TermMemory (LSTM) and Gated Recurrent Unit (GRU) totrain and forecast the trends of stock price based on thetechnical indicators Finally we use the directional evaluationindicators such as accuracy rate (AR) precision rate (PR)recall rate (RR) F1-Score (F1) Area Under Curve (AUC) andthe performance evaluation indicators such as winning rate(WR) annualized return rate (ARR) annualized Sharpe ratio(ASR) and maximum drawdown (MDD)) to evaluate thetrading performance of these various algorithms or strategies

From the experiments we canfind that the traditionalMLalgorithms have a better performance than DNN algorithmsin all directional evaluation indicators except for PR inSPICS in CSICS DNN algorithms have a better performancein AR PR and F1 expert for RR and AUC (1) Tradingperformance without transaction cost is as follows the WRof traditional ML algorithms have a better performance thanthose of DNN algorithms in both SPICS and CSICS TheARR and ASR of all ML algorithms are significantly greaterthan those of the benchmark index (SampP 500 index andCSI 300 index) and BAH strategy the MDD of all MLalgorithms are significantly greater than that of BAH strategyand are significantly less than that of the benchmark indexIn all ML algorithms there are always some traditional MLalgorithms whose trading performance (ARR ASR MDD)can be comparable to the best DNN algorithms ThereforeDNN algorithms are not always the best choice and theperformance of some traditional ML algorithms has nosignificant difference from that of DNN algorithms eventhose traditional ML algorithms can perform well in ARRand ASR (2) Trading performance with transaction costis as follows the trading performance (WR ARR ASRand MDD) of all machine learning algorithms is decreasingwith the increase of transaction cost as in actual tradingsituation Under the same transaction cost structure theperformance reductions of DNN algorithms especially MLPDBN and SAE are smaller than those of traditional MLalgorithms which shows that DNN algorithms have strongertolerance and risk control ability to the changes of transactioncost Moreover the impact of transparent transaction coston SPICS is greater than slippage while the opposite istrue on CSICS Through multiple comparative analysis ofthe different transaction cost structures the performance oftrading algorithms is significantly smaller than that withouttransaction cost which shows that trading performance issensitive to transaction cost The contribution of this paperis that we use nonparametric statistical test methods tocompare differences in trading performance for differentML algorithms in both cases of transaction cost and notransaction cost Therefore it is helpful for us to select the

Mathematical Problems in Engineering 3

1 Data Acquisition

Data Source

Soware

2 Data Preparation

EX RightDividend

Feature Generation

Data Normalization

3 LearningAlgorithm

Machine LearningAlgorithms

Walk-ForwardTrainingPrediction

Algorithm Design ofTrading Signals

4 PerformanceCalculation

DirectionalEvaluation Indicators

PerformanceEvaluation Indicators

Back-testingAlgorithms

5 e ExperimentalResults

Statistical TestingMethod

Trading Evaluationwithout Transaction

Cost

Trading Evaluationwith Transaction Cost

Figure 1 The framework for predicting stock price trends based on ML algorithms

most suitable algorithm from these ML algorithms for stocktrading both in the US stock market and the Chinese A-sharemarket

The remainder of this paper is organized as followsSection 2 describes the architecture of this work Section 3gives the parameter settings of these ML models and thealgorithm for generating trading signals based on the MLmodels mentioned in this paper Section 4 gives the direc-tional evaluation indicators performance evaluation indi-cators and backtesting algorithms Section 5 uses nonpa-rameter statistical test methods to analyze and evaluate theperformance of these different algorithms in the twomarketsSection 6 gives the analysis of impact of transaction coston performance of ML algorithms for trading Section 7gives some discussions of differences in trading performanceamong different algorithms from the perspective of dataalgorithms transaction cost and suggestions for algorithmictrading Section 8 provides a comprehensive conclusion andfuture research directions

2 Architecture of the Work

The general framework of predicting the future price trendsof stocks trading process and backtesting based on MLalgorithms is shown in Figure 1 This article is organizedfrom data acquisition data preparation intelligent learningalgorithm and trading performance evaluation In this studydata acquisition is the first step Where should we get dataand what software should we use to get data quickly andaccurately are something that we need to consider In thispaper we use R language to do all computational proceduresMeanwhile we obtain SPICS and CSICS from Yahoo financeand Netease Finance respectively Secondly the task ofdata preparation includes ex-dividendrights for the acquireddata generating a large number of well-recognized technicalindicators as features and using max-min normalization todeal with the features so that the preprocessed data canbe used as the input of ML algorithms [34] Thirdly thetrading signals of stocks are generated by the ML algorithmsIn this part we train the DNN models and the traditional

ML algorithms by a WFA method then the trained MLmodels will predict the direction of the stocks in a futuretime which is considered as the trading signal Fourthly wegive some widely used directional evaluation indicators andperformance evaluation indicators and adopt a backtestingalgorithm for calculating the indicators Finally we use thetrading signal to implement the backtesting algorithm ofstock daily trading strategy and then apply statistical testmethod to evaluate whether there are statistical significantdifferences among the performance of these trading algo-rithms in both cases of transaction cost and no transactioncost

3 ML Algorithms

31 ML Algorithms and Their Parameter Settings Given atraining dataset D the task of ML algorithm is to classifyclass labels correctly In this paper we will use six traditionalML models (LR SVM CART RF BN and XGB) and sixDNN models (MLP DBN SAE RNN LSTM and GRU) asclassifiers to predict the ups and downs of the stock prices[34] Themain model parameters and training parameters ofthese ML learning algorithms are shown in Tables 1 and 2

InTables 1 and 2 features and class labels are set accordingto the input format of various ML algorithms in R languageMatrix (m n) represents amatrix withm rows and n columnsArray (p m n) represents a tensor and each layer of thetensor is Matrix (m n) and the height of the tensor is p c(h1 h2 h3 ) represents a vector where the length of thevector is the number of hidden layers and the 119894-th elementof c is the number of neurons of the 119894-th hidden layer Inthe experiment 119898 = 250 represents that we use the data ofthe past 250 trading days as training samples in each roundof WFA 119899 = 44 represents that the data of each day has 44features In Table 2 the parameters of DNN models such asactivation function learning rate batch size and epoch areall default values in the algorithms of R programs

32WFAMethod WFA [35] is a rolling training methodWeuse the latest data instead of all past data to train the model

4 Mathematical Problems in Engineering

Table 1 Main parameter settings of traditional ML algorithms

Input Features Label Main parametersLR Matrix(25044) Matrix(2501) A specification for the model link function is logitSVM Matrix(25044) Matrix(2501) The kernel function used is Radial Basis kernel Cost of constraints violation is 1CART Matrix(25044) Matrix(2501) The maximum depth of any node of the final tree is 20 The splitting index can be Gini coefficientRF Matrix(25044) Matrix(2501) The Number of trees is 500 Number of variables randomly sampled as candidates at each split is 7BN Matrix(25044) Matrix(2501) the prior probabilities of class membership is the class proportions for the training setXGB Matrix(25044) Matrix(2501) The maximum depth of a tree is 10 the max number of iterations is 15 the learning rate is 03

Table 2 Main parameter settings of DNN algorithms

Input Features Label Learning rate Dimensions of hidden layers Activation function Batch size EpochMLP Matrix(25044) Matrix(2501) 08 c(2515105) sigmoid 100 3DBN Matrix(25044) Matrix(2501) 08 c(2515105) sigmoid 100 3SAE Matrix(25044) Matrix(2501) 08 c(20105) sigmoid 100 3RNN Array(125044) Array(12501) 001 c(105) sigmoid 1 1LSTM Array(125044) Array(12501) 001 c(105) sigmoid 1 1GRU Array(125044) Array(12501) 001 c(105) sigmoid 1 1

and then apply the trainedmodel to implement the predictionfor the out-of-sample data (testing dataset) of the future timeperiod After that a new training set which is the previoustraining set walk one step forward is carried out the trainingof the next round WFA can improve the robustness and theconfidence of the trading strategy in real-time trading

In this paper we useML algorithms and theWFAmethodto do stock price trend predictions as trading signals In eachstep we use the data from the past 250 days (one year) as thetraining set and the data for the next 5 days (one week) asthe test set Each stock contains data of 2000 trading daysso it takes (2000-250)5 = 350 training sessions to produce atotal of 1750 predictions which are the trading signals of dailytrading strategy TheWFAmethod is as shown in Figure 2

33 The Algorithm Design of Trading Signal In this part weuseML algorithms as classifiers to predict the ups and downsof the stock in SPICS and CSICS and then use the predictionresults as trading signals of daily trading We use the WFAmethod to train each ML algorithm We give the generatingalgorithm of trading signals according to Figure 2 which isshown in Algorithm 1

4 Evaluation Indicators andBacktesting Algorithm

41 Directional Evaluation Indicators In this paper we useML algorithms to predict the direction of stock price sothe main task of the ML algorithms is to classify returnsTherefore it is necessary for us to use directional evaluationindicators to evaluate the classification ability of these algo-rithms

The actual label values of the dataset are sequences ofsets DOWN UP Therefore there are four categories ofpredicted label values and actual label values which areexpressed as TU FU FD and TD TU denotes the number ofUP that the actual label values are UP and the predicted label

Table 3 Confusion matrix of two classification results of MLalgorithm

Predicted label valuesUP DOWN

Actual label values UP TU FDDOWN FU TD

values are also UP FU denotes the number of UP that theactual label values are DOWN but the predicted label valuesare UP TD denotes the number of DOWN that the actuallabel values are DOWN and the predicted label values areDOWN FD denotes the number of DOWN that the actuallabel values are UP but the predicted label values are DOWNas shown in Table 3 Table 3 is a two-dimensional table calledconfusionmatrix It classifies predicted label values accordingto whether predicted label values match real label values Thefirst dimension of the table represents all possible predictedlabel values and the second dimension represents all real labelvalues When predicted label values equal real label valuesthey are correct classifications The correct prediction labelvalues lie on the diagonal line of the confusion matrix Inthis paper what we are concerned about is that when thedirection of stock price is predicted to be UP tomorrow webuy the stock at todayrsquos closing price and sell it at tomorrowrsquosclosing price when we predict the direction of stock price tobe DOWN tomorrow we do nothing So UP is a ldquopositiverdquolabel of our concern

In most of classification tasks AR is generally usedto evaluate performance of classifiers AR is the ratio ofthe number of correct predictions to the total number ofpredictions That is as follows

119860119877 =(119879119880 + 119879119863)

(119879119880 + 119865119863 + 119865119880 + 119879119863)(1)

Mathematical Problems in Engineering 5

ML Algorithm

44-dim

2000

-dim

44-dim

44-dim

44-dim

44-dim

44-dim

44-dim

250-

dim

5-di

m25

0-di

m5-

dim

250-

dim

5-di

m

1-dim

1-dim

1-dim

1-dim

5-di

m5-

dim

5-di

m

1750

-dim

ConcatenateML Algorithm

ML Algorithm

Raw

Inpu

t Dat

a

Figure 2The schematic diagram of WFA (training and testing)

Input Stock SymbolsOutput Trading Signals(1) N=Length of Stock Symbols(2) L=Length of Trading Days(3) P=Length of Features(4) k= Length of Training Dataset for WFA(5) n= Length of Sliding Window for WFA(6) for (i in 1 N) (7) Stock=Stock Symbols[i](8) M=(L-k)n(9) Trading Signal=NULL(10) for (j in 1M) (11) Dataset= Stock[(k+nlowast(j-1))(k+n+nlowast(j-1)) 1(P+1)](12) Train=Dataset[1k1(1+P)](13) Test= Dataset[(k+1)(k+n)1P](14) Model=ML Algorithm(Train)(15) Probability=Model(Test)(16) if (Probabilitygt=05) (17) Trading Signal0=1(18) else (19) Trading Signal0=0(20) (21) (22) Trading Signal=c (Trading Signal Trading Signal0)(23) (24) return (Trading Signal)

Algorithm 1 Generating trading signal in R language

6 Mathematical Problems in Engineering

In this paper ldquoUPrdquo is the profit source of our tradingstrategiesThe classification ability ofML algorithm is to eval-uate whether the algorithms can recognize ldquoUPrdquo Thereforeit is necessary to use PR and RR to evaluate classificationresults These two evaluation indicators are initially appliedin the field of information retrieval to evaluate the relevanceof retrieval results

PR is a ratio of the number of correctly predicted UP toall predicted UP That is as follows

119875119877 =119879119880

(119879119880 + 119865119880)(2)

High PR means that ML algorithms can focus on ldquoUPrdquorather than ldquoDOWNrdquo

RR is the ratio of the number of correctly predicted ldquoUPrdquoto the number of actually labeled ldquoUPrdquo That is as follows

119875119877 =119879119880

(119879119880 + 119865119863)(3)

High RR can capture a large number of ldquoUPrdquo and beeffectively identified In fact it is very difficult to present analgorithm with high PR and RR at the same time Thereforeit is necessary to measure the classification ability of theML algorithm by using some evaluation indicators whichcombine PR with RR F1-Score is the harmonic average ofPR and AR F1 is a more comprehensive evaluation indicatorThat is as follows

1198651= 2 lowast 119875119877 lowast

119860119877

(119875119877 + 119860119877)(4)

Here it is assumed that theweights of PR andRR are equalwhen calculating F1 but this assumption is not always correctIt is feasible to calculate F1 with different weights for PR andRR but determining weights is a very difficult challenge

AUC is the area under ROC (Receiver Operating Charac-teristic) curve ROC curve is often used to check the tradeoffbetween finding TU and avoiding FU Its horizontal axisis FU rate and its vertical axis is TU rate Each point onthe curve represents the proportion of TU under differentFU thresholds [36] AUC reflects the classification ability ofclassifier The larger the value the better the classificationability It is worth noting that two different ROC curves maylead to the same AUC value so qualitative analysis should becarried out in combination with the ROC curve when usingAUCvalue In this paper we use R language package ldquoROCRrdquoto calculate AUC

42 Performance Evaluation Indicator Performance evalua-tion indicator is used for evaluating the profitability and riskcontrol ability of trading algorithms In this paper we usetrading signals generated by ML algorithms to conduct thebacktesting and apply the WR ARR ASR and MDD to dothe trading performance evaluation [34] WR is a measureof the accuracy of trading signals ARR is a theoretical rateof return of a trading strategy ASR is a risk-adjusted returnwhich represents return from taking a unit risk [37] and therisk-free return or benchmark is set to 0 in this paper MDDis the largest decline in the price or value of the investmentperiod which is an important risk assessment indicator

43 Backtesting Algorithm Using historical data to imple-ment trading strategy is called backtesting In research andthe development phase of trading model the researchersusually use a new set of historical data to do backtesting Fur-thermore the backtesting period should be long enoughbecause a large number of historical data can ensure that thetrading model can minimize the sampling bias of data Wecan get statistical performance of tradingmodels theoreticallyby backtesting In this paper we get 1750 trading signals foreach stock If tomorrowrsquos trading signal is 1 we will buy thestock at todayrsquos closing price and then sell it at tomorrowrsquosclosing price otherwise we will not do stock trading Finallywe get AR PR RR F1 AUC WR ARR ASR and MDD byimplementing backtesting algorithm based on these tradingsignals

5 Comparative Analysis ofDifferent Trading Algorithms

51 Nonparametric Statistical Test Method In this part weuse the backtesting algorithm(Algorithm 2) to calculate theevaluation indicators of different trading algorithms In orderto test whether there are significant differences betweenthe evaluation indicators of different ML algorithms thebenchmark indexes and the BAH strategies it is necessaryto use analysis of variance and multiple comparisons to givethe answers Therefore we propose the following nine basichypotheses for significance test in which Hja (119895 = 1 2 3 45 6 7 8 9) are the null hypothesis and the correspondingalternative assumptions areHjb (119895 = 1 2 3 4 5 6 7 8 9)Thelevel of significance is 005

For any evaluation indicator 119895 isin 119860119877 119875119877 119877119877 1198651 119860119880119862119882119877119860119877119877 119860119878119877119872119863119863 and any trading strategy 119894 isin 119872119871119875119863119861119873 119878119860119864 119877119873119873 119871119878119879119872 119866119877119880 119871119877 119878119881119872 119873119861119862119860119877119879 119877119865119883119866119861119861119860119867 119861119890119899119888ℎ119898119886119903119896 119894119899119889119890119909 the null hypothesis a is Hjaalternative hypotheses b is Hjb (119895 = 1 2 3 4 5 6 7 8 9represent AR PR RR F1 AUC WR ARR ASR MDDrespectively)

Hja the evaluation indicator j of all strategies are thesameHjb the evaluation indicator j of all strategies are notthe same

It is worth noting that any evaluation indicator of alltrading algorithm or strategy does not conform to the basichypothesis of variance analysisThat is it violates the assump-tion that the variances of any two groups of samples are thesame and each group of samples obeys normal distributionTherefore it is not appropriate to use t-test in the analysisof variance and we should take the nonparametric statisticaltest method instead In this paper we use the Kruskal-Wallisrank sum test [38] to carry out the analysis of variance If thealternative hypothesis is established we will need to furtherapply the Nemenyi test [39] to do the multiple comparisonsbetween trading strategies

52 Comparative Analysis of Performance of Different TradingStrategies in SPICS Table 4 shows the average value of

Mathematical Problems in Engineering 7

Input TS TS is trading signals of a stockOutput AR PR RR F1 AUC WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) Bt=Benchmark Index [ldquoClosing Pricerdquo] B is the closing price of benchmark index(3) WR=NULL ARR=NULL ASR=NULL MDD=NULL(4) for (i in 1 N) (5) Stock Data=Stock Code List[i](6) Pt=Stock Data [ldquoClosing Pricerdquo](7) Labelt= Stock Data [ldquoLabelrdquo](8) BDRRt=(Bt-Bt-1) Bt-1 BDRR is the daily return rate of benchmark index(9) DRRt= (Pt-Pt-1)Pt-1 DRR is daily return rateThat is daily return rate of BAH strategy(10) TDRRt=lag (TSt)lowastDRRt TDRR is the daily return through trading(11) Table=Confusion Matrix(TS Label)(12) AR[i]=sum(adj(Table))sum(Table)(13) PR[i]=Table[2 2]sum(Table[ 2])(14) RR[i]=Table[2 2]sum(Table[2 ])(15) F1=2lowastPR[i]lowastRR[i](PR[i]+RR[i])(16) Pred=prediction (TS Label)(17) AUC[i]=performance (Pred measure=ldquoaucrdquo)yvalues[[1]](18) WR[i]=sum (TDRRgt0)sum(TDRR =0)(19) ARR[i]=Returnannualized (TDRR) TDRR BDRR or DRR can be used(20) ASR[i]=SharpeRatioannualized (TDRR) TDRR BDRR or DRR can be used(21) MDD[i]=maxDrawDown (TDRR) TDRR BDRR or DRR can be used(22) AR=c (AR AR[i])(23) PR=c (PR PR[i])(24) RR=c (RR RR[i])(25) F1=c (F1 F1[i])(26) AUC=c (AUC AUC[i])(27) WR=c (WR WR[i])(28) ARR=c (ARR ARR[i])(29) ASR=c (ASR ASR[i])(30) MDD=c (MDD MDD[i])(31) (32) Performance=cbind (AR PR RR F1 AUC WR ARR ASR MDD)(33) return (Performance)

Algorithm 2 Backtesting algorithm of daily trading strategy in R language

Table 4 Trading performance of different trading strategies in the SPICS Best performance of all trading strategies is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGBAR mdash mdash 05205 05189 05201 05025 05013 04986 06309 05476 06431 06491 06235 06600PR mdash mdash 07861 07764 07781 05427 05121 04911 06514 05270 06595 06474 06733 06738RR mdash mdash 05274 05263 05273 05245 05253 05239 06472 05762 06599 06722 06325 06767F1 mdash mdash 06258 06217 06229 05332 05183 05065 06491 05480 06595 06591 06517 06751AUC mdash mdash 05003 05001 05002 04997 05005 04992 06295 05489 06418 06491 06199 06590WR 05450 05235 05676 05680 05683 05843 05825 05844 05266 05930 05912 05859 05831 05891ARR 01227 01603 03333 03298 03327 02945 02921 02935 03319 02976 03134 02944 03068 03042ASR 08375 06553 15472 15415 15506 15768 15575 15832 13931 16241 16768 15822 16022 16302MDD 01939 04233 03584 03585 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338

various trading algorithms in AR PR RR F1 AUC WRARR ASR and MDD We can see that the AR RR F1 andAUC of XGB are the greatest in all trading algorithms TheWR of NB is the greatest in all trading strategies The ARRof MLP is the greatest in all trading strategies including thebenchmark index (SampP 500 index) and BAH strategy TheASR of RF is the greatest in all trading strategies TheMDDofthe benchmark index is the smallest in all trading strategies

It is worth noting that the ARR and ASR of all ML algorithmsare greater than those of BAH strategy and the benchmarkindex

(1) Through the hypothesis test analysis of H1a and H1bwe can obtain p valuelt22e-16

Therefore there are statistically significant differencesbetween the AR of all trading algorithms Therefore we needto make multiple comparative analysis further as shown in

8 Mathematical Problems in Engineering

Table 5Multiple comparison analysis between theAR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 10000GRU 00000 00000 00000 08273 09811CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00232 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 07649SVM 00000 00000 00000 00000 00000 00000 06057 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00002 02010 00000

Table 6Multiple comparison analysis between the PR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 09999SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00034GRU 00000 00000 00000 00000 01472CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 07869 05786 00000 00000RF 00000 00000 00000 00000 00000 00000 08056 00000LR 00000 00000 00000 00000 00000 00000 09997 00000 02626SVM 00000 00000 00000 00000 00000 00000 00008 00000 03104 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00491 00000 09999

Table 5 The number in the table is a p value of any two algo-rithms of Nemenyi test When p valuelt005 we think thatthe two trading algorithms have a significant differenceotherwise we cannot deny the null assumption that the meanvalues of AR of the two algorithms are equal From Tables 5and 4 we can see that the AR of all DNN models are signif-icantly lower than those of all traditional MLmodelsTheARof MLP DBN and SAE are significantly greater than those ofRNN LSTM and GRU There are no significant differencesamong the AR of MLP DBN and SAE There are no sig-nificant differences among the AR of RNN LSTM and GRU

(2) Through the hypothesis test analysis of H2a and H2bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between the PR of all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 6 The number in the table is a pvalue of any two algorithms of Nemenyi test From Tables 6and 4 we can see that the PR of MLP DBN and SAE aresignificantly greater than that of other trading algorithmsThe PR of LSTM is not significantly different from that ofGRU and NBThe PR of GRU is significantly lower than thatof all traditional ML algorithms The PR of NB is significantlylower than that of other traditional ML algorithms

(3) Through the hypothesis test analysis of H3a and H3bwe can obtain p valuelt22e-16 So there are statistically

significant differences between the RR of all trading algo-rithms Therefore we need to make multiple comparativeanalysis further as shown in Table 7 The number in thetable is a p value of any two algorithms of Nemenyi testFrom Tables 7 and 4 we can see that there is no significantdifference among the RR of all DNN models but the RRof any DNN model is significantly lower than that of alltraditional ML models The RR of NB is significantly lowerthan that of other traditional ML algorithms The RR ofCART is significantly lower than that of other traditional MLalgorithms except for NB

(4) Through the hypothesis test analysis of H4a and H4bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between the F1 of all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 8 The number in the table is a pvalue of any two algorithms of Nemenyi test From Tables8 and 4 we can see that there is no significant differenceamong the F1 of MLP DBN and SAE The F1 of MLP DBNand SAE are significantly greater than that of RNN LSTMGRU andNB but are significantly smaller than that of RF LRSVM and XGBThe F1 of GRU and LSTMhave no significantdifference but they are significantly smaller than that of alltraditional ML algorithms The F1 of XGB is significantlygreater than that of all other trading algorithms

Mathematical Problems in Engineering 9

Table 7Multiple comparison analysis between the RR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 10000 10000 10000LSTM 10000 10000 10000 10000GRU 09999 10000 09999 10000 10000CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00485 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 00555SVM 00000 00000 00000 00000 00000 00000 00197 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00010 09958 00000

Table 8Multiple comparison analysis between the F1 of any two trading algorithms The p value of the two trading strategies with significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 09998SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00810GRU 00000 00000 00000 00000 03489CART 00861 00061 00117 00000 00000 00000NB 00000 00000 00000 04635 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00078 00000LR 00000 00000 00000 00000 00000 00000 00173 00000 10000SVM 00007 00000 00000 00000 00000 00000 09797 00000 03336 04825XGB 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000

Table 9 Multiple comparison analysis between the AUC of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 10000 10000 10000LSTM 10000 10000 10000 09999GRU 10000 10000 10000 10000 09975CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00270 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 05428SVM 00000 00000 00000 00000 00000 00000 03125 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00002 03954 00000

(5) Through the hypothesis test analysis of H5a and H5bwe can obtain p valuelt22e-16 So there are statisticallysignificant differences between the AUC of all trading algo-rithms Therefore we need to make multiple comparativeanalysis further as shown in Table 9 The number in thetable is a p value of any two algorithms of Nemenyi testFrom Tables 9 and 4 we can see that there is no significantdifference among the AUC of all DNN models The AUC of

all DNN models are significantly smaller than that of anytraditional ML model

(6) Through the hypothesis test analysis of H6a and H6bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between theWRof all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 10 The number in the table is pvalue of any two algorithms of Nemenyi test From Tables 4

10 Mathematical Problems in Engineering

Table10M

ultip

lecomparis

onanalysisbetweentheW

Rof

anytwotradingalgorithm

sTh

epvalueo

fthe

twotradingstr

ategiesw

ithsig

nificantd

ifference

isin

boldface

Index

BAH

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

BAH

000

00MLP

000

00000

00DBN

000

00000

0010

000

SAE

000

00000

0010

000

1000

0RN

N000

00000

00000

00000

00000

00LSTM

000

00000

00000

00000

00000

0009974

GRU

000

11000

00000

01000

00000

0010

000

09961

CART

000

0009998

000

00000

00000

00000

00000

00000

00NB

000

00000

00000

00000

00000

00000

31000

00000

38000

00RF

000

00000

00000

00000

00000

0000118

000

0100140

000

0010

000

LR000

00000

00000

00000

00000

0010

000

08508

1000

0000

00004

320117

7SV

M000

00000

00000

00000

00000

0010

000

1000

010

000

000

00000

01000

0609780

XGB

000

00000

00000

00000

00000

0002660

000

8402927

000

0009831

09989

07627

00376

Mathematical Problems in Engineering 11

Table 11Multiple comparison analysis between theARRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00001 00006 00001LSTM 00000 00000 00000 00002 00000 10000GRU 00000 00000 00001 00008 00001 10000 10000CART 00000 00000 10000 10000 10000 00001 00000 00001NB 00000 00000 00021 00094 00022 10000 09998 10000 00018RF 00000 00000 07978 09524 08036 01685 00874 01962 07745 05861LR 00000 00000 00002 00012 00002 10000 10000 10000 00002 10000 02408SVM 00000 00000 02375 04806 02427 07029 05214 07457 02178 09778 09999 08015XGB 00000 00000 00674 01856 00694 09423 08466 09576 00600 09996 09905 09739 10000

Table 12Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 09667MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 08763 07617 08998LSTM 00000 00000 09922 09701 09949 10000GRU 00000 00000 06124 04563 06537 10000 09996CART 00000 00000 00002 00005 00002 00000 00000 00000NB 00000 00000 00467 00233 00557 09529 07037 09971 00000RF 00000 00000 00000 00000 00000 00291 00042 01062 00000 08010LR 00000 00000 07506 06025 07859 10000 10000 10000 00000 09872 00602SVM 00000 00000 01759 01020 02010 09982 09399 10000 00000 10000 04671 09998XGB 00000 00000 00099 00044 00122 07548 03776 09470 00000 10000 09681 08791 09997

and 10 we can see that the WR of MLP DBN and SAE haveno significant difference but they are significantly higherthan that of BAH and benchmark index and significantlylower than that of other trading algorithms TheWR of RNNLSTM and GRU have no significant difference but they aresignificantly higher than that of CART and significantly lowerthan that of NB and RF The WR of LR is not significantlydifferent from that of RF SVM and XGB

(7) Through the analysis of the hypothesis test of H7aand H7b we obtain p valuelt22e-16 Therefore there aresignificant differences between the ARR of all trading strate-gies including the benchmark index and BAH We needto do further multiple comparative analysis as shown inTable 11 From Tables 4 and 11 we can see that the ARR ofthe benchmark index and BAH are significantly lower thanthat of all ML algorithms The ARR of MLP DBN and SAEare significantly greater than that of RNN LSTM GRU NBand LR but not significantly different from that of CARTRF SVM and XGB there is no significant difference betweenthe ARR of MLP DBN and SAE The ARR of RNN LSTM

and GRU are significantly less than that of CART but theyare not significantly different from that of other traditionalML algorithms In all traditional ML algorithms the ARR ofCART is significantly greater than that of NB and LR butotherwise there is no significant difference between ARR ofany other two algorithms

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore there are significantdifferences between ASR of all trading strategies includingthe benchmark index and BAH The results of our multiplecomparative analysis are shown in Table 12 From Tables 4and 12 we can see that the ASR of the benchmark index andBAH are significantly smaller than that of all ML algorithmsThe ASR of MLP and DBN are significantly greater than thatof CART and are significantly smaller than that of NB RFand XGB but there is no significant difference between MLPDBN and other algorithms The ASR of SAE is significantlygreater than that of CART and significantly less than that ofRF and XGB but there is no significant difference betweenSAE and other algorithms The ASR of RNN and LSTM

12 Mathematical Problems in Engineering

Table 13 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00052DBN 00000 00031 10000SAE 00000 00012 10000 10000RNN 00000 00000 01645 02243 03556LSTM 00000 00000 06236 07173 08511 10000GRU 00000 00000 00245 00381 00760 10000 09860CART 00000 00000 01496 02057 03309 10000 10000 10000NB 00000 00000 00786 01136 01999 10000 09994 10000 10000RF 00000 00000 00002 00004 00012 08964 04248 09980 09109 09713LR 00000 00000 05451 06428 07935 10000 10000 09933 10000 09998 05015SVM 00000 00000 02433 03194 04734 10000 10000 09999 10000 10000 08155 10000XGB 00000 00000 00103 00167 00360 09998 09462 10000 09999 10000 09998 09685 09989

Table 14 Trading performance of different trading strategies in CSICS Best performance of all trading strategies is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGBAR mdash mdash 05175 05167 05163 05030 04993 04993 05052 05084 05090 05084 05112 05087PR mdash mdash 07548 07436 07439 05414 04964 04956 05022 05109 05128 04967 05695 05026RR mdash mdash 05252 05250 05248 05234 05224 05223 05279 05307 05311 05318 05295 05315F1 mdash mdash 06150 06108 06108 05320 05086 05082 05143 05192 05214 05132 05483 05164AUC mdash mdash 05027 05024 05020 05006 04995 04996 05049 05078 05082 05086 05074 05085WR 05222 05090 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803ARR 00633 02224 05731 05704 05678 05248 05165 05113 05534 06125 04842 05095 05004 04938ASR 02625 04612 14031 14006 13935 14880 15422 15505 12232 11122 14379 15582 14231 14698MDD 04808 06697 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632

are significantly greater than that of CART and significantlyless than that of RF but there is no significant differencebetweenRNN LSTM and other algorithmsTheASRofGRUis significantly greater than that of CART but there is nosignificant difference between GRU and other traditional MLalgorithms In all traditional ML algorithms the ASR of allalgorithms are significantly greater than that of CART butotherwise there is no significant difference between ASR ofany other two algorithms

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between MDD of trading strategies includingthe benchmark index and the BAH The results of multiplecomparative analysis are shown in Table 13 From Tables4 and 13 we can see that MDD of any ML algorithm issignificantly greater than that of the benchmark index butsignificantly smaller than that of BAH strategy The MDDof MLP and DBN are significantly smaller than those ofGRU RF and XGB but there is no significant differencebetween MLP DBN and other algorithms The MDD ofSAE is significantly smaller than that of XGB but there isno significant difference between SAE and other algorithmsOtherwise there is no significant difference betweenMDDofany other two algorithms

In a word the traditional ML algorithms such as NBRF and XGB have good performance in most directional

evaluation indicators such as AR PR and F1 The DNNalgorithms such as MLP have good performance in PR andARR In traditional ML algorithms the ARR of CART RFSVM and XGB are not significantly different from that ofMLP DBN and SAE the ARR of CART is significantlygreater than that of LSTM GRU and RNN but otherwisethe ARR of all traditional ML algorithms are not significantlyworse than that of LSTM GRU and RNN The ASR of alltraditional ML algorithms except CART are not significantlyworse than that of the six DNNmodels even the ASR of NBRF and XGB are significantly greater than that of some DNNalgorithms The MDD of RF and XGB are significantly lessthat of MLP DBN and SAE the MDD of all traditional MLalgorithms are not significantly different from that of LSTMGRU and RNNThe ARR and ASR of all ML algorithms aresignificantly greater than that of BAH and the benchmarkindex the MDD of any ML algorithm is significantly greaterthan that of the benchmark index but significantly less thanthat of BAH strategy

53 Comparative Analysis of Performance of Different TradingStrategies in CSICS The analysis methods of this part aresimilar to Section 52 From Table 14 we can see that the ARPR and F1 of MLP are the greatest in all trading algorithmsThe RR AUC WR and ASR of LR are the greatest inall trading algorithms respectively The ARR of NB is the

Mathematical Problems in Engineering 13

Table 15Multiple comparison analysis between theARof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 01857GRU 00000 00000 00000 04439 10000CART 00000 00000 00000 09765 00024 00131NB 00000 00001 00002 00022 00000 00000 01810RF 00000 00002 00005 00007 00000 00000 00941 10000LR 00000 00000 00000 00076 00000 00000 03454 10000 10000SVM 00217 00766 01309 00000 00000 00000 00003 08314 09352 06360XGB 00000 00001 00001 00025 00000 00000 01930 10000 10000 10000 08168

Table 16Multiple comparison analysis between the PRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 09906 09781NB 00000 00000 00000 00000 01716 01234 08940RF 00000 00000 00000 00000 00319 00205 05271 10000LR 00000 00000 00000 00000 10000 10000 09951 02099 00422SVM 00000 00000 00000 01157 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00000 09922 09811 10000 08836 05086 09960 00000

highest in all trading strategies The MDD of CSI 300 index(benchmark index) is the smallest in all trading strategiesTheWRARR and ASR of all ML algorithms are greater thanthose of the benchmark index and BAH strategy

(1) Through the hypothesis test analysis of H1a and H1bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the AR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 15The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 15 we can see that the AR ofMLPDBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms except for SVM The ARof GRU is significantly smaller than that of all traditional MLalgorithms There is no significant difference between the ARof any two traditional ML algorithms except for CART andSVM

(2) Through the hypothesis test analysis of H2a and H2bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the PR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 16 The number in the tableis a p value of any two algorithms of Nemenyi test FromTables 14 and 16 we can see that the PR of MLP DBN and

SAE are significantly greater than that of all other tradingalgorithms and the PR of MLP DBN and SAE have nosignificant difference The PR of SVM is significantly greaterthan that of all other traditional ML algorithms which haveno significant difference between any two algorithms exceptfor SVM The PR of RNN is significantly greater than thatof all traditional ML algorithms except for SVM The PR ofGRU and LSTM are not significantly different from that of alltraditional ML algorithms except for SVM and LR

(3) Through the hypothesis test analysis of H3a and H3bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the RR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 17 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 17 we can see that the RR of all DNN models arenot significantly different There is no significant differenceamong the RR of all traditional ML algorithms The RR ofRNN GRU and LSTM are significantly smaller than that ofany traditional ML algorithm except for CART

(4) Through the hypothesis test analysis of H4a and H4bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the F1 of all trading algorithms There-fore we need to do further multiple comparative analysis and

14 Mathematical Problems in Engineering

Table 17Multiple comparison analysis between the RRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 09996 09996 10000LSTM 09309 09314 09781 09999GRU 09660 09663 09916 10000 10000CART 09744 09742 09225 05809 01509 02138NB 01093 01088 00574 00075 00004 00007 08861RF 00537 00534 00260 00028 00001 00002 07544 10000LR 00330 00328 00152 00015 00001 00001 06498 10000 10000SVM 03444 03434 02170 00434 00033 00059 09920 10000 09998 09991XGB 00193 00192 00085 00007 00000 00000 05344 10000 10000 10000 09960

Table 18 Multiple comparison analysis between the F1 of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 07211 06670NB 00000 00000 00000 00136 00132 00099 08664RF 00000 00000 00000 00786 00016 00011 05162 10000LR 00000 00000 00000 00000 09440 09208 10000 05675 02181SVM 00000 00000 00000 00178 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00001 03138 02679 10000 09937 08849 09964 00000

Table 19 Multiple comparison analysis between the AUC of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 09999 10000RNN 09945 09985 10000LSTM 05273 06382 09259 09937GRU 08448 09102 09958 10000 10000CART 06921 05835 02356 00801 00014 00096NB 00002 00001 00000 00000 00000 00000 02616RF 00001 00001 00000 00000 00000 00000 02002 10000LR 00000 00000 00000 00000 00000 00000 00930 10000 10000SVM 00027 00014 00001 00000 00000 00000 06454 10000 09999 09980XGB 00000 00000 00000 00000 00000 00000 01257 10000 10000 10000 09993

the results are shown in Table 18The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 18 we can see that the F1 of MLP DBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms There is no significantdifference among traditionalML algorithms except SVM andthe F1 of SVM is significantly greater than that of all othertraditional ML algorithms

(5) Through the hypothesis test analysis of H5a and H5bwe can obtain p valuelt22e-16Therefore there are significantdifferences between theAUCof all trading algorithmsThere-fore we need to do further multiple comparative analysis andthe results are shown in Table 19 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 19 we can see that the AUC of all DNN models haveno significant difference There is no significant difference

Mathematical Problems in Engineering 15

Table 20 Multiple comparison analysis between the WR of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 04117MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00002 00006 00000LSTM 00000 00000 00000 00000 00000 09772GRU 00000 00000 00000 00000 00000 09911 10000CART 09931 00000 00000 00000 00000 00000 00000 00000NB 00031 00000 00001 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00205 06437 05358 00000 00000LR 00000 00000 00000 00000 00000 00010 01611 01105 00000 00000 10000SVM 00000 00000 00000 00000 00000 09914 10000 10000 00000 00000 05322 01090XGB 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000

Table 21Multiple comparison analysis between theARRof any two trading strategiesThepvalue of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00007MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 04790 06355 07182LSTM 00000 00000 02512 03806 04630 10000GRU 00000 00000 02235 03454 04249 10000 10000CART 00000 00000 08301 09217 09542 10000 09999 09998NB 00000 00000 10000 10000 10000 02920 01295 01125 06517RF 00000 00000 00020 00048 00076 08705 09735 09806 05393 00006LR 00000 00000 02058 03222 03995 10000 10000 10000 09996 01019 09845SVM 00000 00000 10000 00803 01114 09993 10000 10000 09659 00165 09999 10000XGB 00000 00000 10000 00333 00484 09916 09997 09998 08789 00057 10000 09999 10000

between the AUC of all traditional ML algorithms TheAUC of all traditional ML algorithms except for CART aresignificantly greater than that of any DNN model There isno significant difference among the AUC ofMLP SAE DBNRNN and CART

(6)Through the hypothesis test analysis of H6a and H6bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the WR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 20 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 20 we can see that the WR of BAH and benchmarkindex have no significant difference but they are significantlysmaller than that of anyML algorithmTheWRofMLPDBNand SAE are significantly smaller than that of the other trad-ing algorithms but there is no significant difference betweenthe WR of MLP DBN and SAE The WR of LSTM andGRU have no significant difference but they are significantlysmaller than that of XGB and significantly greater than that of

CART and NB In traditional MLmodels the WR of NB andCART are significantly smaller than that of other algorithmsThe WR of XGB is significantly greater than that of all otherML algorithms

(7)Through the analysis of the hypothesis test of H7a andH7b we obtain p valuelt22e-16

Therefore there are significant differences between theARR of all trading strategies including the benchmark indexand BAH strategy Therefore we need to do further multiplecomparative analysis and the results are shown in Table 21FromTables 14 and 21 we can see that ARR of the benchmarkindex and BAH are significantly smaller than that of alltrading algorithms The ARR of MLP is significantly higherthan that of RF but there is no significant difference betweenMLP and other algorithms The ARR of SAE and DBN aresignificantly higher than that of RF and XGB but they arenot significantly different fromARR of other algorithms TheARR of NB is significantly higher than that of RF SVMand XGB But otherwise there is no significant difference

16 Mathematical Problems in Engineering

Table 22Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 08877MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 09099 08862 08114LSTM 00000 00000 03460 03080 02239 09999GRU 00000 00000 02132 01853 01270 09981 10000CART 00000 00000 00158 00195 00327 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000 00000 07298RF 00000 00000 10000 10000 10000 09968 07444 05789 00018 00000LR 00000 00000 01181 01003 00650 09879 10000 10000 00000 00000 04044SVM 00000 00000 10000 10000 10000 09849 05952 04238 00042 00000 10000 02704XGB 00000 00000 09937 09902 09746 10000 09878 09532 00001 00000 10000 08723 09998

Table 23 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00006DBN 00000 00004 10000SAE 00000 00023 10000 10000RNN 00000 00000 00320 00421 00111LSTM 00000 00000 00002 00003 00000 09947GRU 00000 00000 00001 00001 00000 09767 10000CART 00000 00000 01238 01538 00521 10000 09241 08305NB 00000 01875 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 01180 01469 00493 10000 09298 08401 10000 00000LR 00000 00000 00001 00002 00000 09881 10000 10000 08821 00000 08898SVM 00000 00000 03285 03839 01701 09999 07011 05424 10000 00000 10000 06216XGB 00000 00000 00308 00405 00106 10000 09951 09783 10000 00000 10000 09890 09998

between any other two algorithms Therefore the ARR ofmost traditional ML models are not significantly worse thanthat of the best DNNmodel

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore There are significantdifferences betweenASRof all trading strategies including thebenchmark index and BAH strategy The results of multiplecomparative analysis are shown in Table 22 From Tables 14and 22 we can see that the ASR of the benchmark indexand BAH are significantly smaller than that of all tradingalgorithms The ASR of all ML algorithms are significantlyhigher than that of CART and NB but there is no significantdifference between the ASR of CART and NB Beyond thatthere is no significant difference between any other twoalgorithms Therefore the ASR of all traditional ML modelsexcept NB and CART are not significantly worse than that ofany DNNmodel

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between the MDD of these trading strategies

including the benchmark index and the BAH strategyThe results of multiple comparative analysis are shown inTable 23 From Tables 14 and 23 we can see that the MDDof the benchmark index is significantly smaller than that ofother trading strategies including BAH strategy TheMDD ofBAH is significantly greater than that of all trading algorithmsexcept NBTheMDDofMLPDBN and SAE are significantlylower than that of NB but significantly higher than thatof RNN LSTM GRU LR and XGB The MDD of NB issignificantly greater than that of all other trading algorithmsBeyond that there is no significant difference between anyother two algorithms Therefore all ML algorithms expectNB especially LSTM RNN GRU LR and XGB can play arole in controlling trading risk

In a word some DNN models such as MLP DBN andSAE have good performance in AR PR and F1 traditionalML algorithms such as LR and XGB have good performanceinAUCandWRTheARRof some traditionalML algorithmssuch as CART NB LR and SVM are not significantlydifferent from that of the six DNN models The ASR of the

Mathematical Problems in Engineering 17

six DNN algorithms are not significantly different from alltraditional ML models except NB and CART The MDD ofLR and XGB are significantly smaller than those of MLPDBN and SAE and are not significantly different fromthat of LSTM GRU and RNN The ARR and ASR of allML algorithms are significantly greater than those of BAHand benchmark index the MDD of all ML algorithms aresignificantly smaller than that of the benchmark index butsignificantly greater than that of BAH strategy

From the above analysis and evaluation we can see thatthe directional evaluation indicators of some DNN modelsare very competitive in CSICS while the indicators of sometraditional ML algorithms have excellent performance inSPICS Whether in SPICS or CSICS the ARR and ASR ofall ML algorithms are significantly greater than that of thebenchmark index and BAH strategy respectively In all MLalgorithms there are always some traditional ML algorithmswhich are not significantly worse than the best DNN modelfor any performance evaluation indicator (ARR ASR andMDD)Therefore if we do not consider transaction cost andother factors affecting trading performance of DNN modelsare alternative but not the best choice when they are appliedto stock trading

In the same period the ARR of any ML algorithm inCSICS is significantly greater than that of the same algorithmin SPICS (p valuelt0001 in theNemenyi test)Meanwhile theMDD of any ML algorithm in CSICS is significantly greaterthan that of the same algorithm in SPICS (p value lt0001in the Nemenyi test) The results show that the quantitativetrading algorithms can more easily obtain excess returns inthe Chinese A-share market but the volatility risk of tradingin Chinese A-share market is significantly higher than that ofthe US stock market in the past 8 years

6 The Impact of Transaction Cost onPerformance of ML Algorithms

Trading cost can affect the profitability of a stock tradingstrategy Transaction cost that can be ignored in long-termstrategies is significantly magnified in daily trading Howevermany algorithmic trading studies assume that transactioncost does not exist ([10 17] etc) In practice frictions suchas transaction cost can distort the market from the perfectmodel in textbooks The cost known prior to trading activityis referred to as transparent such as commissions exchangefees and taxes The costs that has to be estimated are knownas implicit including comprise bid-ask spread latency orslippage and related market impact This section focuses onthe transparent and implicit cost and how do they affecttrading performance in daily trading

61 Experimental Settings and Backtesting Algorithm In thispart the transparent transaction cost is calculated by a certainpercentage of transaction turnover for convenience theimplicit transaction cost is very complicated in calculationand it is necessary to make a reasonable estimate for therandom changes of market environment and stock pricesTherefore we only discuss the impact of slippage on tradingperformance

The transaction cost structures of American stocks aresimilar to that of Chinese A-shares We assume that transpar-ent transaction cost is calculated by a percentage of turnoversuch as less than 05 [40 41] and 02 and 05 in theliterature [42] It is different for the estimation of slippage

In some quantitative trading simulation software such asJoinQuant [43] and Abuquant [44] the slippage is set to 002The transparent transaction cost and implicit transaction costare charged in both directions when buying and selling Itis worth noting that the transparent transaction cost varieswith the different brokers while the implicit transaction costis related to market liquidity market information networkstatus trading software etc

We set slippages s = s0=0 s1=001 s2=002 s3=003s4=004 the transparent transaction cost c = c0=0 c1=0001c2=0002 c3=0003 c4=0004 c5=0005 For different s ccombinations we study the impact of different transactioncost structures on trading performance We assume thatbuying and selling positions are one unit so the turnover isthe corresponding stock price When buying stocks we notonly need to pay a certain percentage cost of the purchaseprice but also need to pay an uncertain slippage cost Thatis we need to pay a higher price than the real-time price119875119905minus1

when we are buying But when selling stocks we notonly need to pay a certain percentage cost of the sellingprice but also to pay an uncertain slippage cost Generallyspeaking we need to sell at a price lower than the real-timeprice 119875

119905 It is worth noting that our trading strategy is self-

financing If ML algorithms predict the continuous occur-rence of buying signals or selling signals ie |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 0 we will continue to hold or do nothingso the transaction cost at this time is 0 when |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 1 it is indicated that the position maybe changed from holding to selling or from empty positionto buying At this time we would pay transaction costdue to the trading operation Finally we get a real yieldis

119877119890119905119905le119862119897119900119904119890119875119903119894119888119890

119905minus 119862119897119900119904119890119875119903119894119888119890

119905minus1

119862119897119900119904119890119875119903119894119888119890119905minus1

119875119905= 119862119897119900119904119890119875119903119894119888119890

119905

lowast (1 minus 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816)

minus 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816

119875119905minus1

= 119862119897119900119904119890119875119903119894119888119890119905minus1

lowast (1 + 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816)

+ 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816

119877119890119905119905=119875119905minus 119875119905minus1

119875119905minus1

(5)

where 119862119897119900119904119890119875119903119894119888119890119905

denotes the 119905-th closing price119879119903119886119889119890119878119894119892119899119886119897

119905denotes the 119905-th trading signal 119875

119905denotes

the 119905-th executing price and 119877119890119905119905denotes the 119905-th return rate

We propose a backtesting algorithm with transaction costbased on the above analysis as is shown in Algorithm 3

18 Mathematical Problems in Engineering

Input TS TS is trading signals of a stocks s is slippagec c is transparent transaction cost

Output WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) WR=NULL ARR=NULL ASR=NULL MDD=NULL(3) for (i in 1 N) (4) Stock Data=Stock Code List[i](5) ClosePricet=Stock Data [ldquoClosing Pricerdquo](6) Pt =ClosePricet lowast(1-clowastabs(TSt-TSt-1)) - slowastabs(TSt-TSt-1)(7) Pt-1 =ClosePricetlowast(1+clowastabs(TSt-TSt-1)) + slowastabs(TSt-TSt-1)(8) Rett= (Pt- Pt-1) Pt Ret is the return rate series(9) TDRR=lag (TS)lowastRet TDRR is the daily return through trading(10) WR[i]=sum (TDRRgt0)sum(TDRR =0)(11) ARR[i]=Returnannualized (TDRR)(12) ASR[i]=SharpeRatioannualized (TDRR)(13) MDD[i]=maxDrawDown (TDRR)(14) WR=c (WR WR[i])(15) ARR=c (ARR ARR[i])(16) ASR=c (ASR ASR[i])(17) MDD=c (MDD MDD[i])(18) (19) return (WR ARR ASR MDD)

Algorithm 3 Backtesting algorithm with transaction cost in R language

62 Analysis of Impact of Transaction Cost on the TradingPerformance of SPICS Transaction cost is one of the mostimportant factors affecting trading performance In US stocktrading transparent transaction cost can be charged accord-ing to a fixed fee per order or month or a floating fee basedon the volume and turnover of each transaction Sometimescustomers can also negotiate with broker to determinetransaction cost The transaction cost charged by differentbrokers varies greatly Meanwhile implicit transaction costis not known beforehand and the estimations of them arevery complex Therefore we assume that the percentageof turnover is the transparent transaction cost for ease ofcalculation In the aspect of implicit transaction cost we onlyconsider the impact of slippage on trading performance

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 24 WR is decreasing with the increase oftransaction cost for any trading algorithm which is intuitiveWhen the transaction cost is set to (s c) = (004 0005) theWR of each algorithm is the lowest Compared with setting(s c) = (0 0) the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR and SVM to XGB are reduced by580 597 591 1583 1804 1395 2171 16042216 1854 1850 and 2597 respectively ThereforeMLP DBN and SAE are more tolerant to transaction costGenerally speaking the DNN models have stronger capacityto accommodate transaction cost than the traditional MLmodels From the single trading algorithm such as MLP ifwe do not consider slippage ie s=0 the average WR ofMLP is 05510 under transaction cost structures (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not considertransparent transaction cost ie c=0 the averageWRofMLP

is 05618 under transaction cost structures (s1 c0) (s2 c0)(s3 c0) (s4 c0) so transparent transaction cost has greaterimpact than slippageThroughmultiple comparative analysisthe WR under the transaction cost structure (s1 c0) is notsignificantly different from the WR without transaction costfor MLP DBN and SAETheWR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the WR under the transaction cost structure (s1 c0) (s2 c0) are not significantly different from theWRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 25 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the lowest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 4031 4157 and 4093 respectivelywhile the ARR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin accounts For a general setting of s and c ie (s c) = (0020003) ARR of MLP DBN and SAE decrease by 23262400 and 2361 respectively while the ARR of otheralgorithms decrease by more than 50 and that of CARTand XGB decrease bymore than 100ThereforeMLP DBNand SAE are more tolerant to high transaction cost Fromsingle trading algorithm such as RNN if we do not considerslippage ie s=0 the average ARR of RNN is 01434 under

Mathematical Problems in Engineering 19

Table24Th

eWRof

SPICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

05676

05680

05683

05843

05825

05844

05266

05930

05912

05859

05831

05891

(s0c1)

05615

05618

05621

05669

05626

05694

05052

05752

05663

05654

05630

05599

(s0c2)

05560

05560

05564

05507

05442

05553

04847

05585

05429

05463

05438

05324

(s0c3)

05507

05506

05510

05353

05269

05418

04652

05424

05205

05278

05253

05061

(s0c4)

05457

05454

05460

05206

05101

05289

044

7005277

04996

05105

05084

04818

(s0c5)

05410

05407

05412

05071

04946

05170

04303

05138

04803

04947

04924

04594

(s1c0)

056

49056

53056

5605778

05751

05785

05190

058

61058

2405782

05759

05788

(s1c1)

05594

05597

05600

05619

05571

05648

04991

05700

05597

05595

05574

05521

(s1c2)

05539

05539

05544

05458

05389

05508

04788

05534

05364

05406

05383

05249

(s1c3)

05487

05486

05491

05305

05215

05375

04597

05375

05141

05223

05200

04988

(s1c4)

05438

05436

05441

05163

05052

05249

044

1805231

04938

05054

05034

04750

(s1c5)

05394

05390

05396

05032

04902

05132

04255

05097

04751

04900

04880

04532

(s2c0)

05628

05631

05635

05729

056

9705741

05134

058

1105758

05726

05704

05713

(s2c1)

05573

05574

05578

05568

05515

05602

04931

05647

05527

05535

05515

05442

(s2c2)

05518

05518

05523

05408

05336

05463

04729

05482

05297

05349

05326

05172

(s2c3)

05469

05467

05472

05260

05164

05334

04543

05330

05082

05171

05150

04918

(s2c4)

05421

05417

05423

05120

05004

05209

04368

05187

04881

05004

04986

046

85(s2c5)

05377

05373

05379

04993

04858

05096

04209

05055

04699

04855

04835

044

73(s3c0)

05606

05609

05612

05678

05640

05694

05074

05759

05690

05668

05646

05635

(s3c1)

05552

05553

05558

05518

05460

05556

04872

05595

05460

05478

05459

05365

(s3c2)

05499

05498

05503

05362

05284

05422

046

7505434

05233

05295

05273

05099

(s3c3)

05450

05448

05453

05216

05114

05292

04491

05284

05020

05120

05098

04849

(s3c4)

05405

05401

05407

05080

04960

05172

04321

05146

04827

04959

04940

04622

(s3c5)

05362

05357

05363

04955

04816

05063

04166

05017

04651

04815

04793

044

17(s4c0)

05587

05589

05593

05630

05588

05652

05019

05710

05627

05613

05593

05562

(s4c1)

05533

05533

05537

05470

05407

05513

04815

05544

05395

05424

05404

05290

(s4c2)

05480

05479

05484

05316

05232

05380

04620

05386

05171

05242

05220

05026

(s4c3)

05432

05429

05435

05172

05067

05253

044

4005241

04964

05070

05051

04782

(s4c4)

05388

05384

05391

05041

04917

05137

04274

05106

04775

04914

04897

04564

(s4c5)

05347

05341

05347

04918

04774

05029

04123

04979

046

0204773

04752

04361

20 Mathematical Problems in Engineering

Table25Th

eARR

ofSP

ICSford

ailytradingwith

different

transactioncost

Ther

esultthatthere

isno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

03332

03296

03325

02943

02920

02934

03317

02975

03133

02942

03067

03041

(s0c1)

03128

030

8703118

02439

02327

02521

02266

02496

02384

02336

02400

02137

(s0c2)

02924

02879

02912

01936

01735

02108

01216

02017

01636

01731

01734

01234

(s0c3)

02721

02672

02706

01433

0114

301697

00168

01539

00889

01126

01070

00333

(s0c4)

02519

02464

02500

00931

00553

01285

-00878

01062

00143

00522

004

06-00567

(s0c5)

02316

02257

02294

00430

-00037

00875

-019

2400586

-00602

-0008

-00257

-014

66(s1c0)

03249

03212

03242

027

7802729

02794

029

53028

18028

9802747

028

5502762

(s1c1)

03046

03004

03035

02274

02136

02381

01902

02339

02149

02141

02188

01859

(s1c2)

02842

02796

02829

01771

01544

01969

00853

01861

01401

01536

01523

00957

(s1c3)

02639

02588

02623

01269

00953

01557

-00195

01383

00654

00931

00858

000

56(s1c4)

02437

02381

02417

00767

00363

0114

6-012

41009

06-00091

00328

00195

-00844

(s1c5)

02234

02174

02211

00266

-00226

00735

-02285

00430

-00836

-00275

-0046

8-01742

(s2c0)

03167

03129

03159

026

1302538

026

54025

89026

61026

6302551

026

43024

84(s2c1)

02964

02921

02952

02110

01946

02241

01539

02182

01914

01946

01977

01581

(s2c2)

0276

02713

02746

01607

01354

01829

00490

01704

0116

701341

01312

006

79(s2c3)

02557

02505

02540

0110

400763

01418

-00557

01227

004

2000737

006

47-00221

(s2c4)

02355

02298

02334

006

0300173

01007

-016

0300750

-00325

00134

-00016

-01120

(s2c5)

02153

02091

02129

00102

-00416

00597

-0264

700274

-010

69-00469

-00678

-02018

(s3c0)

030

85030

46030

7602448

02348

02514

02225

02504

02428

02356

02431

02206

(s3c1)

02881

02838

02869

01945

01756

02102

0117

502026

01680

01751

01765

01304

(s3c2)

02678

02630

02663

01442

01164

01690

00127

01548

00933

0114

601100

004

02(s3c3)

02476

02422

02457

00940

00574

01279

-00919

01071

00187

00543

00436

-00498

(s3c4)

02273

02215

02252

00439

-00016

00868

-019

6400595

-00558

-0006

-00227

-013

97(s3c5)

02071

02008

02047

-00062

-0060

5004

58-0300

800119

-013

02-00662

-00889

-02294

(s4c0)

03003

02962

02993

02284

02157

02374

01862

02348

02193

02161

02219

01929

(s4c1)

02799

02754

02786

01781

01565

01962

00813

01870

01445

01556

01554

01026

(s4c2)

02597

02547

02580

01278

00974

01551

-00235

01392

00699

00952

00889

00125

(s4c3)

02394

02339

02375

00776

00384

0114

0-012

8100915

-0004

700349

00226

-00774

(s4c4)

02192

02132

02169

00275

-00205

00729

-02326

00439

-00792

-00254

-00437

-016

73(s4c5)

01989

01926

01964

-00225

-00794

00319

-033

69-00037

-015

35-00856

-010

99-02570

Mathematical Problems in Engineering 21

the transaction cost structures (s0 c1) (s0 c2) (s0 c3) (s0c4) (s0 c5) if we do not consider transparent transactioncost ie c=0 the average ARR of RNN is 02531 under thetransaction cost structure (s1 c0) (s2 c0) (s3 c0) (s4c0) so transparent transaction cost has greater impact thanslippage Through multiple comparative analysis the ARRunder the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s0 c1) are not significantly different from the ARRwithout transaction cost for MLP DBN and SAE the ARRunder all other transaction cost structures are significantlysmaller than theARRwithout transaction cost For all tradingalgorithms except for MLP DBN and SAE the ARR underthe transaction cost structures (s1 c0) (s2 c0) are notsignificantly different from the ARR without transactioncost the ARR under all other transaction cost structures aresignificantly smaller than the ARR without transaction cost

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 26 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theASR of each algorithm is the lowest Compared with settingwithout transaction cost the ASR of MLP DBN and SAEreduce by 3997 4123 and 4066 respectively while theASR of other trading algorithms reduce by more than 90compared with the case of no transaction cost Thereforeexcessive transaction cost will significantly reduce ASR Fora general setting of s and c ie (s c) = (002 0003) theASR of MLP DBN and SAE decrease by 2262 2336and 2302 respectively while the ASR of other algorithmsdecrease by more than 50 the ASR of CART and XGBdecrease by more than 100Therefore MLP DBN and SAEare more tolerant to transaction cost From single tradingalgorithm such as NB if we do not consider slippage ies=0 the average ASR of NB is 08052 under the transactioncost structure (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5)if we do not consider transparent transaction cost ie c=0the average ASR of NB is 14182 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has greater impact than slippage Throughmultiple comparative analysis the ASR under the transactioncost structures (s1 c0) (s2 c0) (s3 c0) (s0 c1) are notsignificantly different from the ASR without transaction costfor MLP DBN and SAE the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the ASR under the transaction cost structures(s1 c0) (s2 c0) are not significantly different from the ASRwithout transaction cost the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 27 MDD increases with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the settings without transaction cost theMDD of MLP DBN and SAE increase by 932 1108 and

1032 respectively The MDD of other trading algorithmsincrease by more than 80 compared with those withoutconsidering transaction costTherefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 483 580 and 533respectively while the MDD of other algorithms increase bymore than 35 and theMDDofCART RF andXGB increasebymore than 100Therefore MLP DBN and SAE are moretolerant to transaction cost As awhole theDNNmodels havestronger capacity to accommodate transaction cost than thetraditional ML models From single trading algorithm suchas GRU if we do not consider slippage ie s=0 the averageMDD of GRU is 04459 under the transaction cost structures(s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do notconsider transparent transaction cost ie c=0 the averageMDD of GRU is 03559 under the transaction cost structures(s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparent transactioncost has greater impact than slippage Through multiplecomparative analysis the MDD under any the transactioncost structure is not significantly different from the MDDwithout transaction cost for MLP DBN and SAE For alltrading algorithms except for MLP DBN and SAE such asLR the MDD under the transaction cost structures (s0 c1)(s1 c0) (s2 c0) (s3 c0) are not significantly different fromthe MDD without transaction cost the MDD under all othertransaction cost structures are significantly greater than theMDD without transaction cost

Through the analysis of the Table 27 performance eval-uation indicators we find that trading performance afterconsidering transaction cost will be worse than that withoutconsidering transaction cost as is in actual trading situationIt is noteworthy that the performance changes of DNNalgorithms especially MLP DBN and SAE are very smallafter considering transaction cost This shows that the threealgorithms have good tolerance to changes of transactioncost Especially for the MDD of the three algorithms thereis no significant difference with that with no transactioncost So we can consider applying them in actual tradingMeanwhile we conclude that the transparent transactioncost has greater impact on the trading performances thanthe slippage for SPICS This is because the prices of SPICSare too high when the transparent transaction cost is setto a certain percentage of turnover In actual transactionsspecial attention needs to be paid to the fact that the trans-action performance under most transaction cost structuresis significantly lower than the trading performance withoutconsidering transaction cost It is worth noting that theperformance of traditional ML algorithm is not worse thanthat ofDNNalgorithmswithout considering transaction costwhile the performance of DNN algorithms is better than thatof traditional ML algorithms after considering transactioncost

63 Analysis of Impact of Transaction Cost on the TradingPerformance of CSICS Similar to Section 62 we will discussthe impact of transaction cost on trading performance ofCSICS in the followings In the Chinese A-share marketthe transparent transaction cost is usually set to a certain

22 Mathematical Problems in Engineering

Table26Th

eASR

ofSP

ICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

1546

815

412

15502

15764

15571

15828

13927

16237

16763

15818

16018

16298

(s0c1)

1456

214

478

14577

1300

012

317

13565

09346

13554

12650

12472

12456

11294

(s0c2)

13639

13527

13635

10191

09015

11262

04657

10822

08482

09074

08846

06236

(s0c3)

12702

12561

12679

07355

05690

08929

-00085

08061

04298

05652

05216

0118

2(s0c4)

11751

11581

11709

04511

02366

06580

-04823

05291

00139

02234

01596

-03812

(s0c5)

1079

10591

10728

01678

-00931

04227

-09500

02534

-039

59-01152

-019

87-08696

(s1c0)

15121

1505

715

149

1492

714

606

15119

1244

915

424

1558

214

825

14974

1488

6(s1c1)

14208

14116

14217

12146

11334

12841

07823

12722

1144

711459

11394

09859

(s1c2)

13279

13159

13270

09325

08020

10526

03105

09977

07267

08048

07772

04792

(s1c3)

12337

12188

12308

064

8204690

08185

-016

4607209

03082

04622

04139

-00257

(s1c4)

11382

11204

11333

03637

01368

05831

-06374

04438

-010

6801208

00524

-052

31(s1c5)

10417

10210

10348

00807

-019

2003478

-110

2501686

-05146

-02169

-0304

7-10083

(s2c0)

1477

1469

914

792

1408

113

632

1440

310

946

1460

114

390

1382

213

922

1346

2(s2c1)

13851

13752

13854

11285

10343

12111

06283

11883

10237

10439

10325

08416

(s2c2)

12916

12789

12901

08454

07021

09785

01547

09128

060

4907019

06696

03346

(s2c3)

11969

11812

11934

05607

03688

07437

-032

0506355

01868

03591

03063

-016

90(s2c4)

11010

10825

10955

02763

00372

05081

-07916

03586

-02268

00183

-00545

-06639

(s2c5)

1004

109827

09967

-0006

-02905

02729

-12533

00841

-06323

-031

79-04101

-114

54(s3c0)

14415

14337

14432

13227

12650

13679

09425

13770

13189

12810

12862

12030

(s3c1)

13490

13384

13488

10419

09348

11375

04733

11039

09023

09413

09252

06971

(s3c2)

12551

12416

12529

07580

060

19090

40-00013

08275

04832

05988

05618

01904

(s3c3)

11599

11435

11558

04731

02688

066

88-04757

05500

00658

02562

01988

-031

16(s3c4)

10636

10443

10575

01891

-00620

04331

-0944

202735

-0346

0-00836

-016

08-08034

(s3c5)

09664

09443

09584

-00924

-03883

01982

-14018

000

00-074

89-04183

-05146

-12808

(s4c0)

14058

13972

1406

812

368

11662

12950

07892

12933

11983

11793

11796

10591

(s4c1)

13127

13013

13119

09549

08350

10634

03180

10190

07807

08386

08177

05527

(s4c2)

12183

1204

12155

06705

05018

08293

-015

6807421

03617

04958

04542

004

68(s4c3)

11226

11055

11179

03857

01691

05938

-06295

046

47-00545

01537

00918

-04529

(s4c4)

1026

1006

10193

01021

-016

0703582

-10948

01888

-0464

2-018

49-02665

-09413

(s4c5)

09286

09057

09199

-017

83-04853

01238

-15478

-00836

-0864

2-05177

-06182

-14142

Mathematical Problems in Engineering 23

Table 27 The MDD of SPICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 03583 03584 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338(s0 c1) 03629 03638 03594 03779 03986 03636 04072 03712 03843 03963 03972 04203(s0 c2) 03677 03695 03647 04302 04707 03968 05168 04127 04842 04729 04787 05735(s0 c3) 03727 03756 03703 04990 05639 04376 06564 04709 06172 05682 05844 07335(s0 c4) 03781 03821 03764 05767 06612 04873 07804 05424 07377 06653 06913 08447(s0 c5) 03839 03890 03828 06529 0746 05444 08730 06162 08272 07501 07808 09118(s1 c0) 03596 03600 03560 03500 036130 03446 03574 03502 03414 03585 03569 03540(s1 c1) 03642 03655 03609 03907 04156 03717 04320 03814 04067 04154 04170 04541(s1 c2) 03691 03712 03662 04466 04936 04066 05534 04270 05172 04971 05049 06168(s1 c3) 03742 03774 03720 05183 05895 04495 06928 04885 06499 05937 06129 07662(s1 c4) 03796 03839 03781 05961 06842 05013 08105 05610 07631 06884 07161 08649(s1 c5) 03856 03909 03847 0671 07646 05595 08946 06342 08451 07691 0800 09235(s2 c0) 03609 03615 03573 03607 03756 03517 03770 03586 03586 03739 03727 03787(s2 c1) 03656 03671 03623 04047 04349 03805 04627 03929 04339 04365 04397 04929(s2 c2) 03705 03729 03678 04642 05176 04171 05916 04424 05504 05218 05327 06577(s2 c3) 03756 03792 03736 05377 06143 04624 07277 05067 06805 06183 06402 07939(s2 c4) 03812 03859 03799 06155 07056 05161 08380 05796 07856 07099 07388 08816(s2 c5) 03873 03930 03866 06887 07816 05751 09126 06517 08606 07864 08172 09331(s3 c0) 03622 03631 03588 03729 03912 03594 04004 03685 03795 03909 03909 04081(s3 c1) 03669 03687 03639 04200 04555 03901 04966 04062 04622 04587 04642 05334(s3 c2) 03719 03746 03694 04826 05423 04286 06295 04589 05833 05465 05607 06936(s3 c3) 03772 03811 03754 05572 06377 04762 07609 05248 07081 06420 06657 08175(s3 c4) 03829 03879 03818 06341 07254 05314 08620 05980 08054 07300 07593 08956(s3 c5) 03894 03954 03888 07056 07972 05909 09275 06689 08740 08022 08325 09412(s4 c0) 03635 03647 03602 03861 04082 03678 04274 03798 04015 04096 04114 04396(s4 c1) 03683 03704 03654 04362 04774 04005 05325 04211 04908 04814 04894 05730(s4 c2) 03734 03765 03712 05013 05664 04410 06667 04758 06142 05707 05875 07253(s4 c3) 03790 03833 03775 05765 06600 04905 07906 05429 07330 06644 06894 08375(s4 c4) 03851 03904 03841 06521 07439 05470 08824 06162 08230 07485 07782 09074(s4 c5) 03917 03981 03913 07218 08115 06067 09395 06857 08858 08165 08463 09480

percentage of turnover and it is the same as the assumptionin the experimental settings As in the US stock market thesmallest unit of price change is 001 (one tick) It is reasonableto set slippage to be 001-005 Of course it should be notedthat the prices fluctuation may be more intense when closingthan that in the middle of a trading day

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 28 the WR is decreasing with the increaseof transaction cost for any trading algorithm When thetransaction cost is set to (s c) = (004 0005) the WR of eachalgorithm is the smallest Comparedwith the settings withouttransaction cost the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR SVM and XGB are reduced by671 688 697 2269 1726 1548 2430 14912484 2112 2112 and 2919 respectively For a generalsetting of s and c ie (s c) = (002 0003) the WR ofMLP DBN and SAE decrease by 410 420 and 430respectively while the WR of other algorithms decrease bymore than 9 the WR of CART RF and XGB decrease by

more than 15 Therefore MLP DBN and SAE are moretolerant to transaction cost From single trading algorithmsuch as LSTM if we do not consider slippage ie s=0 theaverage WR of DBN is 05417 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage WR of LSTM is 05304 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the WR under the transactioncost structures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the WR without transaction cost for MLPDBN SAE and NB the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN SAE and NB the WR under the transaction coststructure (s0 c1) is not significantly different from the WRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

24 Mathematical Problems in Engineering

Table 28 The WR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803(s0 c1) 05523 05527 05525 05525 05608 05620 05009 05227 05612 05665 05571 05595(s0 c2) 05488 05492 05489 05389 05512 05535 04879 05149 05460 05542 05445 05411(s0 c3) 05453 05456 05452 05258 05414 05451 04747 05068 05313 05418 05320 05234(s0 c4) 05417 05419 05414 05127 05320 05368 04622 04991 05172 05297 05202 05067(s0 c5) 05383 05383 05379 05004 05230 05286 04504 04917 05036 05180 05088 04905(s1 c0) 05494 05499 05497 05444 05541 05558 04925 05170 05520 05584 05492 05488(s1 c1) 05456 05459 05456 05286 05424 05456 04775 05080 05342 05437 05345 05275(s1 c2) 05421 05423 05420 05161 05335 05377 04654 05007 05207 05320 05231 05110(s1 c3) 05386 05388 05383 05036 05246 05296 04530 04931 05065 05205 05116 04946(s1 c4) 05353 05354 05349 04915 05156 05218 04419 04861 04937 05095 05007 04795(s1 c5) 05323 05323 05317 04808 05076 05148 04315 04796 04817 04995 04905 04652(s2 c0) 05431 05434 05431 05219 05368 05403 04707 05036 05269 05374 05286 05189(s2 c1) 05395 05397 05393 05078 05266 05314 04573 04956 05115 05242 05154 05005(s2 c2) 05360 05361 05357 04960 05181 05237 04458 04886 04985 05134 05046 04853(s2 c3) 05331 05331 05326 04850 05100 05167 04352 04818 04864 05031 04945 04711(s2 c4) 05300 05300 05293 04743 05018 05093 04252 04752 04746 04931 04846 04572(s2 c5) 05273 05271 05266 04648 04946 05029 04159 04692 04639 04838 04755 04445(s3 c0) 05373 05374 05371 05019 05216 05265 04514 04917 05049 05186 05098 04932(s3 c1) 05341 05341 05336 04902 05128 05188 04399 04846 04917 05074 04990 04775(s3 c2) 05312 05312 05306 04798 05052 05122 04303 04782 04804 04977 04896 04644(s3 c3) 05281 05281 05275 04696 04976 05049 04206 04718 04689 04879 04799 04509(s3 c4) 05252 05251 05245 04598 04901 04984 04110 04657 04581 04785 04707 04378(s3 c5) 05226 05223 05218 04510 04833 04924 04023 04602 04481 04701 04621 04264(s4 c0) 05325 05325 05321 04860 05089 05150 04360 04816 04870 05030 04949 04723(s4 c1) 05294 05294 05289 04753 05010 05079 04258 04750 04752 04928 04849 04588(s4 c2) 05266 05265 05259 04653 04937 05013 04164 04690 04642 04838 04761 04458(s4 c3) 05238 05236 05230 04562 04864 04948 04073 04632 04541 04747 04672 04336(s4 c4) 05211 05208 05203 04475 04798 04891 03985 04577 04440 04662 04586 04218(s4 c5) 05186 05182 05176 04392 04733 04832 03901 04524 04348 04582 04509 04109

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 29 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the smallest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 5073 5175 and 5225 respectivelyWhile the ARR of other trading algorithms decrease bymore than 100 compared with those algorithms withouttransaction cost Therefore excessive transaction cost canlead to serious losses in the accounts For a general settingof s and c ie (s c) = (002 0003) ARR of MLP DBNand SAE decrease by 2741 2797 and 2825 respectivelywhile the ARR other algorithms decrease by more than 50and that of CART NB RF and XGB decrease by more than100 Therefore MLP DBN and SAE are more tolerant totransaction cost From single trading algorithm such as SAEif we do not consider slippage ie s=0 the average ARR ofSAE is 05040 under the transaction cost structure (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not consider

transparent transaction cost ie c=0 the averageARRof SAEis 04468 under the transaction cost structures (s1 c0) (s2c0) (s3 c0) (s4 c0) so transparent transaction cost hassmaller impact than slippage Through multiple comparativeanalysis the ARR under the transaction cost structures (s0c1) (s0 c2) (s0 c3) (s0 c1) (s1 c1) are not significantlydifferent from the ARR without transaction cost for MLPDBN and SAE the ARR under all other transaction coststructures are significantly smaller than the ARR withouttransaction cost For RNN LSTM GRU CART RF LR andSVM the ARR under the transaction cost structures (s0c1) (s0 c2) (s1 c0) are not significantly different fromthe ARR without transaction cost the ARR under all othertransaction cost structures are significantly smaller than theARR without transaction cost For NB and XGB the ARRunder the transaction cost structures (s0 c1) (s1 c0) arenot significantly different from the ARR without transactioncost the ARR under all other transaction cost structuresare significantly smaller than the ARR without transactioncost

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 2: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

2 Mathematical Problems in Engineering

of image recognition and text analysis In some papers theauthors think that these advanced algorithms can capture thedynamic changes of the financial market simulate the tradingprocess of stock and make automatic investment decisions(3) The rapid development of high-performance computinghardware such as Graphics Processing Units (GPUs) largeservers and other devices can provide powerful storagespace and computing power for the use of financial big dataHigh-performance computer equipment accurate and fastintelligent algorithms and financial big data together canprovide decision-making support for programmed and auto-mated trading of stocks which has gradually been acceptedby industry practitioners Therefore the power of financialtechnology is reshaping the financial market and changingthe format of finance

Over the years traditional ML methods have shownstrong ability in trend prediction of stock prices [2ndash16]In recent years artificial intelligence computing methodsrepresented by DNN have made a series of major break-throughs in the fields of Natural Language Processing imageclassification voice translation and so on It is noteworthythat some DNN algorithms have been applied for time seriesprediction and quantitative trading [17ndash34] However mostof the previous studies focused on the prediction of thestock index of major economies in the world ([2 8 11 1315ndash17 22 29 30 32] etc) or selecting a few stocks withlimited features according to their own preferences ([8ndash11 1417 20 22 26 31] etc) or not considering transaction cost([10 14 17 23] etc) or the period of backtesting is veryshort ([2 8 9 11 17 20 22 27] etc) Meanwhile there isno statistical significance test between different algorithmswhich were used in stock trading ([8ndash11 32] etc)That is thecomparison and evaluation of the various trading algorithmslack large-scale stocks datasets considering transaction costand statistical significance testTherefore the performance ofbacktesting may tend to be overly optimistic In this regardwe need to clarify two concerns based on a large-scale stockdataset (1) whether the trading strategies based on the DNNmodels can achieve statistically significant results comparedwith the traditional ML algorithms without transaction cost(2) how do transaction costs affect trading performanceof the ML algorithm These problems constitute the mainmotivation of this research and they are very importantfor quantitative investment practitioners and portfolio man-agersThese solutions of these problems are of great value forpractitioners to do stock trading

In this paper we select 424 SPICS and 185 CSICS from2010 to 2017 as research objects The SPICS and CSICSrepresent the industry development of the worldrsquos top twoeconomies and are attractive to investors around the worldThe stock symbols are shown in the ldquoData Availabilityrdquo Foreach stock in SPICS and CSICS we construct 44 technicalindicators as shown in the ldquoData Availabilityrdquo The labelon the 119879-th trading day is the symbol for the yield ofthe 119879 + 1-th trading day relative to the 119879-th trading dayThat is if the yield is positive the label value is set to 1otherwise 0 For each stock we choose 44 technical indicatorsof 2000 trading days before December 31 2017 to builda stock dataset After the dataset of a stock is built we

choose the walk-forward analysis (WFA) method to trainthe ML models step by step In each step of training weuse 6 traditional ML methods which are support vectormachine (SVM) random forest (RF) logistic regression (LR)naıve Bayes model (NB) classification and regression tree(CART) and eXtreme Gradient Boosting algorithm (XGB)and 6 DNN models which are widely in the field of textanalysis and voice translation such as Multilayer Perceptron(MLP) Deep Belief Network (DBN) Stacked Autoencoders(SAE) Recurrent Neural Network (RNN) Long Short-TermMemory (LSTM) and Gated Recurrent Unit (GRU) totrain and forecast the trends of stock price based on thetechnical indicators Finally we use the directional evaluationindicators such as accuracy rate (AR) precision rate (PR)recall rate (RR) F1-Score (F1) Area Under Curve (AUC) andthe performance evaluation indicators such as winning rate(WR) annualized return rate (ARR) annualized Sharpe ratio(ASR) and maximum drawdown (MDD)) to evaluate thetrading performance of these various algorithms or strategies

From the experiments we canfind that the traditionalMLalgorithms have a better performance than DNN algorithmsin all directional evaluation indicators except for PR inSPICS in CSICS DNN algorithms have a better performancein AR PR and F1 expert for RR and AUC (1) Tradingperformance without transaction cost is as follows the WRof traditional ML algorithms have a better performance thanthose of DNN algorithms in both SPICS and CSICS TheARR and ASR of all ML algorithms are significantly greaterthan those of the benchmark index (SampP 500 index andCSI 300 index) and BAH strategy the MDD of all MLalgorithms are significantly greater than that of BAH strategyand are significantly less than that of the benchmark indexIn all ML algorithms there are always some traditional MLalgorithms whose trading performance (ARR ASR MDD)can be comparable to the best DNN algorithms ThereforeDNN algorithms are not always the best choice and theperformance of some traditional ML algorithms has nosignificant difference from that of DNN algorithms eventhose traditional ML algorithms can perform well in ARRand ASR (2) Trading performance with transaction costis as follows the trading performance (WR ARR ASRand MDD) of all machine learning algorithms is decreasingwith the increase of transaction cost as in actual tradingsituation Under the same transaction cost structure theperformance reductions of DNN algorithms especially MLPDBN and SAE are smaller than those of traditional MLalgorithms which shows that DNN algorithms have strongertolerance and risk control ability to the changes of transactioncost Moreover the impact of transparent transaction coston SPICS is greater than slippage while the opposite istrue on CSICS Through multiple comparative analysis ofthe different transaction cost structures the performance oftrading algorithms is significantly smaller than that withouttransaction cost which shows that trading performance issensitive to transaction cost The contribution of this paperis that we use nonparametric statistical test methods tocompare differences in trading performance for differentML algorithms in both cases of transaction cost and notransaction cost Therefore it is helpful for us to select the

Mathematical Problems in Engineering 3

1 Data Acquisition

Data Source

Soware

2 Data Preparation

EX RightDividend

Feature Generation

Data Normalization

3 LearningAlgorithm

Machine LearningAlgorithms

Walk-ForwardTrainingPrediction

Algorithm Design ofTrading Signals

4 PerformanceCalculation

DirectionalEvaluation Indicators

PerformanceEvaluation Indicators

Back-testingAlgorithms

5 e ExperimentalResults

Statistical TestingMethod

Trading Evaluationwithout Transaction

Cost

Trading Evaluationwith Transaction Cost

Figure 1 The framework for predicting stock price trends based on ML algorithms

most suitable algorithm from these ML algorithms for stocktrading both in the US stock market and the Chinese A-sharemarket

The remainder of this paper is organized as followsSection 2 describes the architecture of this work Section 3gives the parameter settings of these ML models and thealgorithm for generating trading signals based on the MLmodels mentioned in this paper Section 4 gives the direc-tional evaluation indicators performance evaluation indi-cators and backtesting algorithms Section 5 uses nonpa-rameter statistical test methods to analyze and evaluate theperformance of these different algorithms in the twomarketsSection 6 gives the analysis of impact of transaction coston performance of ML algorithms for trading Section 7gives some discussions of differences in trading performanceamong different algorithms from the perspective of dataalgorithms transaction cost and suggestions for algorithmictrading Section 8 provides a comprehensive conclusion andfuture research directions

2 Architecture of the Work

The general framework of predicting the future price trendsof stocks trading process and backtesting based on MLalgorithms is shown in Figure 1 This article is organizedfrom data acquisition data preparation intelligent learningalgorithm and trading performance evaluation In this studydata acquisition is the first step Where should we get dataand what software should we use to get data quickly andaccurately are something that we need to consider In thispaper we use R language to do all computational proceduresMeanwhile we obtain SPICS and CSICS from Yahoo financeand Netease Finance respectively Secondly the task ofdata preparation includes ex-dividendrights for the acquireddata generating a large number of well-recognized technicalindicators as features and using max-min normalization todeal with the features so that the preprocessed data canbe used as the input of ML algorithms [34] Thirdly thetrading signals of stocks are generated by the ML algorithmsIn this part we train the DNN models and the traditional

ML algorithms by a WFA method then the trained MLmodels will predict the direction of the stocks in a futuretime which is considered as the trading signal Fourthly wegive some widely used directional evaluation indicators andperformance evaluation indicators and adopt a backtestingalgorithm for calculating the indicators Finally we use thetrading signal to implement the backtesting algorithm ofstock daily trading strategy and then apply statistical testmethod to evaluate whether there are statistical significantdifferences among the performance of these trading algo-rithms in both cases of transaction cost and no transactioncost

3 ML Algorithms

31 ML Algorithms and Their Parameter Settings Given atraining dataset D the task of ML algorithm is to classifyclass labels correctly In this paper we will use six traditionalML models (LR SVM CART RF BN and XGB) and sixDNN models (MLP DBN SAE RNN LSTM and GRU) asclassifiers to predict the ups and downs of the stock prices[34] Themain model parameters and training parameters ofthese ML learning algorithms are shown in Tables 1 and 2

InTables 1 and 2 features and class labels are set accordingto the input format of various ML algorithms in R languageMatrix (m n) represents amatrix withm rows and n columnsArray (p m n) represents a tensor and each layer of thetensor is Matrix (m n) and the height of the tensor is p c(h1 h2 h3 ) represents a vector where the length of thevector is the number of hidden layers and the 119894-th elementof c is the number of neurons of the 119894-th hidden layer Inthe experiment 119898 = 250 represents that we use the data ofthe past 250 trading days as training samples in each roundof WFA 119899 = 44 represents that the data of each day has 44features In Table 2 the parameters of DNN models such asactivation function learning rate batch size and epoch areall default values in the algorithms of R programs

32WFAMethod WFA [35] is a rolling training methodWeuse the latest data instead of all past data to train the model

4 Mathematical Problems in Engineering

Table 1 Main parameter settings of traditional ML algorithms

Input Features Label Main parametersLR Matrix(25044) Matrix(2501) A specification for the model link function is logitSVM Matrix(25044) Matrix(2501) The kernel function used is Radial Basis kernel Cost of constraints violation is 1CART Matrix(25044) Matrix(2501) The maximum depth of any node of the final tree is 20 The splitting index can be Gini coefficientRF Matrix(25044) Matrix(2501) The Number of trees is 500 Number of variables randomly sampled as candidates at each split is 7BN Matrix(25044) Matrix(2501) the prior probabilities of class membership is the class proportions for the training setXGB Matrix(25044) Matrix(2501) The maximum depth of a tree is 10 the max number of iterations is 15 the learning rate is 03

Table 2 Main parameter settings of DNN algorithms

Input Features Label Learning rate Dimensions of hidden layers Activation function Batch size EpochMLP Matrix(25044) Matrix(2501) 08 c(2515105) sigmoid 100 3DBN Matrix(25044) Matrix(2501) 08 c(2515105) sigmoid 100 3SAE Matrix(25044) Matrix(2501) 08 c(20105) sigmoid 100 3RNN Array(125044) Array(12501) 001 c(105) sigmoid 1 1LSTM Array(125044) Array(12501) 001 c(105) sigmoid 1 1GRU Array(125044) Array(12501) 001 c(105) sigmoid 1 1

and then apply the trainedmodel to implement the predictionfor the out-of-sample data (testing dataset) of the future timeperiod After that a new training set which is the previoustraining set walk one step forward is carried out the trainingof the next round WFA can improve the robustness and theconfidence of the trading strategy in real-time trading

In this paper we useML algorithms and theWFAmethodto do stock price trend predictions as trading signals In eachstep we use the data from the past 250 days (one year) as thetraining set and the data for the next 5 days (one week) asthe test set Each stock contains data of 2000 trading daysso it takes (2000-250)5 = 350 training sessions to produce atotal of 1750 predictions which are the trading signals of dailytrading strategy TheWFAmethod is as shown in Figure 2

33 The Algorithm Design of Trading Signal In this part weuseML algorithms as classifiers to predict the ups and downsof the stock in SPICS and CSICS and then use the predictionresults as trading signals of daily trading We use the WFAmethod to train each ML algorithm We give the generatingalgorithm of trading signals according to Figure 2 which isshown in Algorithm 1

4 Evaluation Indicators andBacktesting Algorithm

41 Directional Evaluation Indicators In this paper we useML algorithms to predict the direction of stock price sothe main task of the ML algorithms is to classify returnsTherefore it is necessary for us to use directional evaluationindicators to evaluate the classification ability of these algo-rithms

The actual label values of the dataset are sequences ofsets DOWN UP Therefore there are four categories ofpredicted label values and actual label values which areexpressed as TU FU FD and TD TU denotes the number ofUP that the actual label values are UP and the predicted label

Table 3 Confusion matrix of two classification results of MLalgorithm

Predicted label valuesUP DOWN

Actual label values UP TU FDDOWN FU TD

values are also UP FU denotes the number of UP that theactual label values are DOWN but the predicted label valuesare UP TD denotes the number of DOWN that the actuallabel values are DOWN and the predicted label values areDOWN FD denotes the number of DOWN that the actuallabel values are UP but the predicted label values are DOWNas shown in Table 3 Table 3 is a two-dimensional table calledconfusionmatrix It classifies predicted label values accordingto whether predicted label values match real label values Thefirst dimension of the table represents all possible predictedlabel values and the second dimension represents all real labelvalues When predicted label values equal real label valuesthey are correct classifications The correct prediction labelvalues lie on the diagonal line of the confusion matrix Inthis paper what we are concerned about is that when thedirection of stock price is predicted to be UP tomorrow webuy the stock at todayrsquos closing price and sell it at tomorrowrsquosclosing price when we predict the direction of stock price tobe DOWN tomorrow we do nothing So UP is a ldquopositiverdquolabel of our concern

In most of classification tasks AR is generally usedto evaluate performance of classifiers AR is the ratio ofthe number of correct predictions to the total number ofpredictions That is as follows

119860119877 =(119879119880 + 119879119863)

(119879119880 + 119865119863 + 119865119880 + 119879119863)(1)

Mathematical Problems in Engineering 5

ML Algorithm

44-dim

2000

-dim

44-dim

44-dim

44-dim

44-dim

44-dim

44-dim

250-

dim

5-di

m25

0-di

m5-

dim

250-

dim

5-di

m

1-dim

1-dim

1-dim

1-dim

5-di

m5-

dim

5-di

m

1750

-dim

ConcatenateML Algorithm

ML Algorithm

Raw

Inpu

t Dat

a

Figure 2The schematic diagram of WFA (training and testing)

Input Stock SymbolsOutput Trading Signals(1) N=Length of Stock Symbols(2) L=Length of Trading Days(3) P=Length of Features(4) k= Length of Training Dataset for WFA(5) n= Length of Sliding Window for WFA(6) for (i in 1 N) (7) Stock=Stock Symbols[i](8) M=(L-k)n(9) Trading Signal=NULL(10) for (j in 1M) (11) Dataset= Stock[(k+nlowast(j-1))(k+n+nlowast(j-1)) 1(P+1)](12) Train=Dataset[1k1(1+P)](13) Test= Dataset[(k+1)(k+n)1P](14) Model=ML Algorithm(Train)(15) Probability=Model(Test)(16) if (Probabilitygt=05) (17) Trading Signal0=1(18) else (19) Trading Signal0=0(20) (21) (22) Trading Signal=c (Trading Signal Trading Signal0)(23) (24) return (Trading Signal)

Algorithm 1 Generating trading signal in R language

6 Mathematical Problems in Engineering

In this paper ldquoUPrdquo is the profit source of our tradingstrategiesThe classification ability ofML algorithm is to eval-uate whether the algorithms can recognize ldquoUPrdquo Thereforeit is necessary to use PR and RR to evaluate classificationresults These two evaluation indicators are initially appliedin the field of information retrieval to evaluate the relevanceof retrieval results

PR is a ratio of the number of correctly predicted UP toall predicted UP That is as follows

119875119877 =119879119880

(119879119880 + 119865119880)(2)

High PR means that ML algorithms can focus on ldquoUPrdquorather than ldquoDOWNrdquo

RR is the ratio of the number of correctly predicted ldquoUPrdquoto the number of actually labeled ldquoUPrdquo That is as follows

119875119877 =119879119880

(119879119880 + 119865119863)(3)

High RR can capture a large number of ldquoUPrdquo and beeffectively identified In fact it is very difficult to present analgorithm with high PR and RR at the same time Thereforeit is necessary to measure the classification ability of theML algorithm by using some evaluation indicators whichcombine PR with RR F1-Score is the harmonic average ofPR and AR F1 is a more comprehensive evaluation indicatorThat is as follows

1198651= 2 lowast 119875119877 lowast

119860119877

(119875119877 + 119860119877)(4)

Here it is assumed that theweights of PR andRR are equalwhen calculating F1 but this assumption is not always correctIt is feasible to calculate F1 with different weights for PR andRR but determining weights is a very difficult challenge

AUC is the area under ROC (Receiver Operating Charac-teristic) curve ROC curve is often used to check the tradeoffbetween finding TU and avoiding FU Its horizontal axisis FU rate and its vertical axis is TU rate Each point onthe curve represents the proportion of TU under differentFU thresholds [36] AUC reflects the classification ability ofclassifier The larger the value the better the classificationability It is worth noting that two different ROC curves maylead to the same AUC value so qualitative analysis should becarried out in combination with the ROC curve when usingAUCvalue In this paper we use R language package ldquoROCRrdquoto calculate AUC

42 Performance Evaluation Indicator Performance evalua-tion indicator is used for evaluating the profitability and riskcontrol ability of trading algorithms In this paper we usetrading signals generated by ML algorithms to conduct thebacktesting and apply the WR ARR ASR and MDD to dothe trading performance evaluation [34] WR is a measureof the accuracy of trading signals ARR is a theoretical rateof return of a trading strategy ASR is a risk-adjusted returnwhich represents return from taking a unit risk [37] and therisk-free return or benchmark is set to 0 in this paper MDDis the largest decline in the price or value of the investmentperiod which is an important risk assessment indicator

43 Backtesting Algorithm Using historical data to imple-ment trading strategy is called backtesting In research andthe development phase of trading model the researchersusually use a new set of historical data to do backtesting Fur-thermore the backtesting period should be long enoughbecause a large number of historical data can ensure that thetrading model can minimize the sampling bias of data Wecan get statistical performance of tradingmodels theoreticallyby backtesting In this paper we get 1750 trading signals foreach stock If tomorrowrsquos trading signal is 1 we will buy thestock at todayrsquos closing price and then sell it at tomorrowrsquosclosing price otherwise we will not do stock trading Finallywe get AR PR RR F1 AUC WR ARR ASR and MDD byimplementing backtesting algorithm based on these tradingsignals

5 Comparative Analysis ofDifferent Trading Algorithms

51 Nonparametric Statistical Test Method In this part weuse the backtesting algorithm(Algorithm 2) to calculate theevaluation indicators of different trading algorithms In orderto test whether there are significant differences betweenthe evaluation indicators of different ML algorithms thebenchmark indexes and the BAH strategies it is necessaryto use analysis of variance and multiple comparisons to givethe answers Therefore we propose the following nine basichypotheses for significance test in which Hja (119895 = 1 2 3 45 6 7 8 9) are the null hypothesis and the correspondingalternative assumptions areHjb (119895 = 1 2 3 4 5 6 7 8 9)Thelevel of significance is 005

For any evaluation indicator 119895 isin 119860119877 119875119877 119877119877 1198651 119860119880119862119882119877119860119877119877 119860119878119877119872119863119863 and any trading strategy 119894 isin 119872119871119875119863119861119873 119878119860119864 119877119873119873 119871119878119879119872 119866119877119880 119871119877 119878119881119872 119873119861119862119860119877119879 119877119865119883119866119861119861119860119867 119861119890119899119888ℎ119898119886119903119896 119894119899119889119890119909 the null hypothesis a is Hjaalternative hypotheses b is Hjb (119895 = 1 2 3 4 5 6 7 8 9represent AR PR RR F1 AUC WR ARR ASR MDDrespectively)

Hja the evaluation indicator j of all strategies are thesameHjb the evaluation indicator j of all strategies are notthe same

It is worth noting that any evaluation indicator of alltrading algorithm or strategy does not conform to the basichypothesis of variance analysisThat is it violates the assump-tion that the variances of any two groups of samples are thesame and each group of samples obeys normal distributionTherefore it is not appropriate to use t-test in the analysisof variance and we should take the nonparametric statisticaltest method instead In this paper we use the Kruskal-Wallisrank sum test [38] to carry out the analysis of variance If thealternative hypothesis is established we will need to furtherapply the Nemenyi test [39] to do the multiple comparisonsbetween trading strategies

52 Comparative Analysis of Performance of Different TradingStrategies in SPICS Table 4 shows the average value of

Mathematical Problems in Engineering 7

Input TS TS is trading signals of a stockOutput AR PR RR F1 AUC WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) Bt=Benchmark Index [ldquoClosing Pricerdquo] B is the closing price of benchmark index(3) WR=NULL ARR=NULL ASR=NULL MDD=NULL(4) for (i in 1 N) (5) Stock Data=Stock Code List[i](6) Pt=Stock Data [ldquoClosing Pricerdquo](7) Labelt= Stock Data [ldquoLabelrdquo](8) BDRRt=(Bt-Bt-1) Bt-1 BDRR is the daily return rate of benchmark index(9) DRRt= (Pt-Pt-1)Pt-1 DRR is daily return rateThat is daily return rate of BAH strategy(10) TDRRt=lag (TSt)lowastDRRt TDRR is the daily return through trading(11) Table=Confusion Matrix(TS Label)(12) AR[i]=sum(adj(Table))sum(Table)(13) PR[i]=Table[2 2]sum(Table[ 2])(14) RR[i]=Table[2 2]sum(Table[2 ])(15) F1=2lowastPR[i]lowastRR[i](PR[i]+RR[i])(16) Pred=prediction (TS Label)(17) AUC[i]=performance (Pred measure=ldquoaucrdquo)yvalues[[1]](18) WR[i]=sum (TDRRgt0)sum(TDRR =0)(19) ARR[i]=Returnannualized (TDRR) TDRR BDRR or DRR can be used(20) ASR[i]=SharpeRatioannualized (TDRR) TDRR BDRR or DRR can be used(21) MDD[i]=maxDrawDown (TDRR) TDRR BDRR or DRR can be used(22) AR=c (AR AR[i])(23) PR=c (PR PR[i])(24) RR=c (RR RR[i])(25) F1=c (F1 F1[i])(26) AUC=c (AUC AUC[i])(27) WR=c (WR WR[i])(28) ARR=c (ARR ARR[i])(29) ASR=c (ASR ASR[i])(30) MDD=c (MDD MDD[i])(31) (32) Performance=cbind (AR PR RR F1 AUC WR ARR ASR MDD)(33) return (Performance)

Algorithm 2 Backtesting algorithm of daily trading strategy in R language

Table 4 Trading performance of different trading strategies in the SPICS Best performance of all trading strategies is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGBAR mdash mdash 05205 05189 05201 05025 05013 04986 06309 05476 06431 06491 06235 06600PR mdash mdash 07861 07764 07781 05427 05121 04911 06514 05270 06595 06474 06733 06738RR mdash mdash 05274 05263 05273 05245 05253 05239 06472 05762 06599 06722 06325 06767F1 mdash mdash 06258 06217 06229 05332 05183 05065 06491 05480 06595 06591 06517 06751AUC mdash mdash 05003 05001 05002 04997 05005 04992 06295 05489 06418 06491 06199 06590WR 05450 05235 05676 05680 05683 05843 05825 05844 05266 05930 05912 05859 05831 05891ARR 01227 01603 03333 03298 03327 02945 02921 02935 03319 02976 03134 02944 03068 03042ASR 08375 06553 15472 15415 15506 15768 15575 15832 13931 16241 16768 15822 16022 16302MDD 01939 04233 03584 03585 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338

various trading algorithms in AR PR RR F1 AUC WRARR ASR and MDD We can see that the AR RR F1 andAUC of XGB are the greatest in all trading algorithms TheWR of NB is the greatest in all trading strategies The ARRof MLP is the greatest in all trading strategies including thebenchmark index (SampP 500 index) and BAH strategy TheASR of RF is the greatest in all trading strategies TheMDDofthe benchmark index is the smallest in all trading strategies

It is worth noting that the ARR and ASR of all ML algorithmsare greater than those of BAH strategy and the benchmarkindex

(1) Through the hypothesis test analysis of H1a and H1bwe can obtain p valuelt22e-16

Therefore there are statistically significant differencesbetween the AR of all trading algorithms Therefore we needto make multiple comparative analysis further as shown in

8 Mathematical Problems in Engineering

Table 5Multiple comparison analysis between theAR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 10000GRU 00000 00000 00000 08273 09811CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00232 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 07649SVM 00000 00000 00000 00000 00000 00000 06057 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00002 02010 00000

Table 6Multiple comparison analysis between the PR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 09999SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00034GRU 00000 00000 00000 00000 01472CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 07869 05786 00000 00000RF 00000 00000 00000 00000 00000 00000 08056 00000LR 00000 00000 00000 00000 00000 00000 09997 00000 02626SVM 00000 00000 00000 00000 00000 00000 00008 00000 03104 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00491 00000 09999

Table 5 The number in the table is a p value of any two algo-rithms of Nemenyi test When p valuelt005 we think thatthe two trading algorithms have a significant differenceotherwise we cannot deny the null assumption that the meanvalues of AR of the two algorithms are equal From Tables 5and 4 we can see that the AR of all DNN models are signif-icantly lower than those of all traditional MLmodelsTheARof MLP DBN and SAE are significantly greater than those ofRNN LSTM and GRU There are no significant differencesamong the AR of MLP DBN and SAE There are no sig-nificant differences among the AR of RNN LSTM and GRU

(2) Through the hypothesis test analysis of H2a and H2bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between the PR of all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 6 The number in the table is a pvalue of any two algorithms of Nemenyi test From Tables 6and 4 we can see that the PR of MLP DBN and SAE aresignificantly greater than that of other trading algorithmsThe PR of LSTM is not significantly different from that ofGRU and NBThe PR of GRU is significantly lower than thatof all traditional ML algorithms The PR of NB is significantlylower than that of other traditional ML algorithms

(3) Through the hypothesis test analysis of H3a and H3bwe can obtain p valuelt22e-16 So there are statistically

significant differences between the RR of all trading algo-rithms Therefore we need to make multiple comparativeanalysis further as shown in Table 7 The number in thetable is a p value of any two algorithms of Nemenyi testFrom Tables 7 and 4 we can see that there is no significantdifference among the RR of all DNN models but the RRof any DNN model is significantly lower than that of alltraditional ML models The RR of NB is significantly lowerthan that of other traditional ML algorithms The RR ofCART is significantly lower than that of other traditional MLalgorithms except for NB

(4) Through the hypothesis test analysis of H4a and H4bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between the F1 of all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 8 The number in the table is a pvalue of any two algorithms of Nemenyi test From Tables8 and 4 we can see that there is no significant differenceamong the F1 of MLP DBN and SAE The F1 of MLP DBNand SAE are significantly greater than that of RNN LSTMGRU andNB but are significantly smaller than that of RF LRSVM and XGBThe F1 of GRU and LSTMhave no significantdifference but they are significantly smaller than that of alltraditional ML algorithms The F1 of XGB is significantlygreater than that of all other trading algorithms

Mathematical Problems in Engineering 9

Table 7Multiple comparison analysis between the RR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 10000 10000 10000LSTM 10000 10000 10000 10000GRU 09999 10000 09999 10000 10000CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00485 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 00555SVM 00000 00000 00000 00000 00000 00000 00197 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00010 09958 00000

Table 8Multiple comparison analysis between the F1 of any two trading algorithms The p value of the two trading strategies with significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 09998SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00810GRU 00000 00000 00000 00000 03489CART 00861 00061 00117 00000 00000 00000NB 00000 00000 00000 04635 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00078 00000LR 00000 00000 00000 00000 00000 00000 00173 00000 10000SVM 00007 00000 00000 00000 00000 00000 09797 00000 03336 04825XGB 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000

Table 9 Multiple comparison analysis between the AUC of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 10000 10000 10000LSTM 10000 10000 10000 09999GRU 10000 10000 10000 10000 09975CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00270 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 05428SVM 00000 00000 00000 00000 00000 00000 03125 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00002 03954 00000

(5) Through the hypothesis test analysis of H5a and H5bwe can obtain p valuelt22e-16 So there are statisticallysignificant differences between the AUC of all trading algo-rithms Therefore we need to make multiple comparativeanalysis further as shown in Table 9 The number in thetable is a p value of any two algorithms of Nemenyi testFrom Tables 9 and 4 we can see that there is no significantdifference among the AUC of all DNN models The AUC of

all DNN models are significantly smaller than that of anytraditional ML model

(6) Through the hypothesis test analysis of H6a and H6bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between theWRof all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 10 The number in the table is pvalue of any two algorithms of Nemenyi test From Tables 4

10 Mathematical Problems in Engineering

Table10M

ultip

lecomparis

onanalysisbetweentheW

Rof

anytwotradingalgorithm

sTh

epvalueo

fthe

twotradingstr

ategiesw

ithsig

nificantd

ifference

isin

boldface

Index

BAH

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

BAH

000

00MLP

000

00000

00DBN

000

00000

0010

000

SAE

000

00000

0010

000

1000

0RN

N000

00000

00000

00000

00000

00LSTM

000

00000

00000

00000

00000

0009974

GRU

000

11000

00000

01000

00000

0010

000

09961

CART

000

0009998

000

00000

00000

00000

00000

00000

00NB

000

00000

00000

00000

00000

00000

31000

00000

38000

00RF

000

00000

00000

00000

00000

0000118

000

0100140

000

0010

000

LR000

00000

00000

00000

00000

0010

000

08508

1000

0000

00004

320117

7SV

M000

00000

00000

00000

00000

0010

000

1000

010

000

000

00000

01000

0609780

XGB

000

00000

00000

00000

00000

0002660

000

8402927

000

0009831

09989

07627

00376

Mathematical Problems in Engineering 11

Table 11Multiple comparison analysis between theARRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00001 00006 00001LSTM 00000 00000 00000 00002 00000 10000GRU 00000 00000 00001 00008 00001 10000 10000CART 00000 00000 10000 10000 10000 00001 00000 00001NB 00000 00000 00021 00094 00022 10000 09998 10000 00018RF 00000 00000 07978 09524 08036 01685 00874 01962 07745 05861LR 00000 00000 00002 00012 00002 10000 10000 10000 00002 10000 02408SVM 00000 00000 02375 04806 02427 07029 05214 07457 02178 09778 09999 08015XGB 00000 00000 00674 01856 00694 09423 08466 09576 00600 09996 09905 09739 10000

Table 12Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 09667MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 08763 07617 08998LSTM 00000 00000 09922 09701 09949 10000GRU 00000 00000 06124 04563 06537 10000 09996CART 00000 00000 00002 00005 00002 00000 00000 00000NB 00000 00000 00467 00233 00557 09529 07037 09971 00000RF 00000 00000 00000 00000 00000 00291 00042 01062 00000 08010LR 00000 00000 07506 06025 07859 10000 10000 10000 00000 09872 00602SVM 00000 00000 01759 01020 02010 09982 09399 10000 00000 10000 04671 09998XGB 00000 00000 00099 00044 00122 07548 03776 09470 00000 10000 09681 08791 09997

and 10 we can see that the WR of MLP DBN and SAE haveno significant difference but they are significantly higherthan that of BAH and benchmark index and significantlylower than that of other trading algorithms TheWR of RNNLSTM and GRU have no significant difference but they aresignificantly higher than that of CART and significantly lowerthan that of NB and RF The WR of LR is not significantlydifferent from that of RF SVM and XGB

(7) Through the analysis of the hypothesis test of H7aand H7b we obtain p valuelt22e-16 Therefore there aresignificant differences between the ARR of all trading strate-gies including the benchmark index and BAH We needto do further multiple comparative analysis as shown inTable 11 From Tables 4 and 11 we can see that the ARR ofthe benchmark index and BAH are significantly lower thanthat of all ML algorithms The ARR of MLP DBN and SAEare significantly greater than that of RNN LSTM GRU NBand LR but not significantly different from that of CARTRF SVM and XGB there is no significant difference betweenthe ARR of MLP DBN and SAE The ARR of RNN LSTM

and GRU are significantly less than that of CART but theyare not significantly different from that of other traditionalML algorithms In all traditional ML algorithms the ARR ofCART is significantly greater than that of NB and LR butotherwise there is no significant difference between ARR ofany other two algorithms

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore there are significantdifferences between ASR of all trading strategies includingthe benchmark index and BAH The results of our multiplecomparative analysis are shown in Table 12 From Tables 4and 12 we can see that the ASR of the benchmark index andBAH are significantly smaller than that of all ML algorithmsThe ASR of MLP and DBN are significantly greater than thatof CART and are significantly smaller than that of NB RFand XGB but there is no significant difference between MLPDBN and other algorithms The ASR of SAE is significantlygreater than that of CART and significantly less than that ofRF and XGB but there is no significant difference betweenSAE and other algorithms The ASR of RNN and LSTM

12 Mathematical Problems in Engineering

Table 13 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00052DBN 00000 00031 10000SAE 00000 00012 10000 10000RNN 00000 00000 01645 02243 03556LSTM 00000 00000 06236 07173 08511 10000GRU 00000 00000 00245 00381 00760 10000 09860CART 00000 00000 01496 02057 03309 10000 10000 10000NB 00000 00000 00786 01136 01999 10000 09994 10000 10000RF 00000 00000 00002 00004 00012 08964 04248 09980 09109 09713LR 00000 00000 05451 06428 07935 10000 10000 09933 10000 09998 05015SVM 00000 00000 02433 03194 04734 10000 10000 09999 10000 10000 08155 10000XGB 00000 00000 00103 00167 00360 09998 09462 10000 09999 10000 09998 09685 09989

Table 14 Trading performance of different trading strategies in CSICS Best performance of all trading strategies is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGBAR mdash mdash 05175 05167 05163 05030 04993 04993 05052 05084 05090 05084 05112 05087PR mdash mdash 07548 07436 07439 05414 04964 04956 05022 05109 05128 04967 05695 05026RR mdash mdash 05252 05250 05248 05234 05224 05223 05279 05307 05311 05318 05295 05315F1 mdash mdash 06150 06108 06108 05320 05086 05082 05143 05192 05214 05132 05483 05164AUC mdash mdash 05027 05024 05020 05006 04995 04996 05049 05078 05082 05086 05074 05085WR 05222 05090 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803ARR 00633 02224 05731 05704 05678 05248 05165 05113 05534 06125 04842 05095 05004 04938ASR 02625 04612 14031 14006 13935 14880 15422 15505 12232 11122 14379 15582 14231 14698MDD 04808 06697 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632

are significantly greater than that of CART and significantlyless than that of RF but there is no significant differencebetweenRNN LSTM and other algorithmsTheASRofGRUis significantly greater than that of CART but there is nosignificant difference between GRU and other traditional MLalgorithms In all traditional ML algorithms the ASR of allalgorithms are significantly greater than that of CART butotherwise there is no significant difference between ASR ofany other two algorithms

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between MDD of trading strategies includingthe benchmark index and the BAH The results of multiplecomparative analysis are shown in Table 13 From Tables4 and 13 we can see that MDD of any ML algorithm issignificantly greater than that of the benchmark index butsignificantly smaller than that of BAH strategy The MDDof MLP and DBN are significantly smaller than those ofGRU RF and XGB but there is no significant differencebetween MLP DBN and other algorithms The MDD ofSAE is significantly smaller than that of XGB but there isno significant difference between SAE and other algorithmsOtherwise there is no significant difference betweenMDDofany other two algorithms

In a word the traditional ML algorithms such as NBRF and XGB have good performance in most directional

evaluation indicators such as AR PR and F1 The DNNalgorithms such as MLP have good performance in PR andARR In traditional ML algorithms the ARR of CART RFSVM and XGB are not significantly different from that ofMLP DBN and SAE the ARR of CART is significantlygreater than that of LSTM GRU and RNN but otherwisethe ARR of all traditional ML algorithms are not significantlyworse than that of LSTM GRU and RNN The ASR of alltraditional ML algorithms except CART are not significantlyworse than that of the six DNNmodels even the ASR of NBRF and XGB are significantly greater than that of some DNNalgorithms The MDD of RF and XGB are significantly lessthat of MLP DBN and SAE the MDD of all traditional MLalgorithms are not significantly different from that of LSTMGRU and RNNThe ARR and ASR of all ML algorithms aresignificantly greater than that of BAH and the benchmarkindex the MDD of any ML algorithm is significantly greaterthan that of the benchmark index but significantly less thanthat of BAH strategy

53 Comparative Analysis of Performance of Different TradingStrategies in CSICS The analysis methods of this part aresimilar to Section 52 From Table 14 we can see that the ARPR and F1 of MLP are the greatest in all trading algorithmsThe RR AUC WR and ASR of LR are the greatest inall trading algorithms respectively The ARR of NB is the

Mathematical Problems in Engineering 13

Table 15Multiple comparison analysis between theARof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 01857GRU 00000 00000 00000 04439 10000CART 00000 00000 00000 09765 00024 00131NB 00000 00001 00002 00022 00000 00000 01810RF 00000 00002 00005 00007 00000 00000 00941 10000LR 00000 00000 00000 00076 00000 00000 03454 10000 10000SVM 00217 00766 01309 00000 00000 00000 00003 08314 09352 06360XGB 00000 00001 00001 00025 00000 00000 01930 10000 10000 10000 08168

Table 16Multiple comparison analysis between the PRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 09906 09781NB 00000 00000 00000 00000 01716 01234 08940RF 00000 00000 00000 00000 00319 00205 05271 10000LR 00000 00000 00000 00000 10000 10000 09951 02099 00422SVM 00000 00000 00000 01157 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00000 09922 09811 10000 08836 05086 09960 00000

highest in all trading strategies The MDD of CSI 300 index(benchmark index) is the smallest in all trading strategiesTheWRARR and ASR of all ML algorithms are greater thanthose of the benchmark index and BAH strategy

(1) Through the hypothesis test analysis of H1a and H1bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the AR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 15The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 15 we can see that the AR ofMLPDBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms except for SVM The ARof GRU is significantly smaller than that of all traditional MLalgorithms There is no significant difference between the ARof any two traditional ML algorithms except for CART andSVM

(2) Through the hypothesis test analysis of H2a and H2bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the PR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 16 The number in the tableis a p value of any two algorithms of Nemenyi test FromTables 14 and 16 we can see that the PR of MLP DBN and

SAE are significantly greater than that of all other tradingalgorithms and the PR of MLP DBN and SAE have nosignificant difference The PR of SVM is significantly greaterthan that of all other traditional ML algorithms which haveno significant difference between any two algorithms exceptfor SVM The PR of RNN is significantly greater than thatof all traditional ML algorithms except for SVM The PR ofGRU and LSTM are not significantly different from that of alltraditional ML algorithms except for SVM and LR

(3) Through the hypothesis test analysis of H3a and H3bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the RR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 17 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 17 we can see that the RR of all DNN models arenot significantly different There is no significant differenceamong the RR of all traditional ML algorithms The RR ofRNN GRU and LSTM are significantly smaller than that ofany traditional ML algorithm except for CART

(4) Through the hypothesis test analysis of H4a and H4bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the F1 of all trading algorithms There-fore we need to do further multiple comparative analysis and

14 Mathematical Problems in Engineering

Table 17Multiple comparison analysis between the RRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 09996 09996 10000LSTM 09309 09314 09781 09999GRU 09660 09663 09916 10000 10000CART 09744 09742 09225 05809 01509 02138NB 01093 01088 00574 00075 00004 00007 08861RF 00537 00534 00260 00028 00001 00002 07544 10000LR 00330 00328 00152 00015 00001 00001 06498 10000 10000SVM 03444 03434 02170 00434 00033 00059 09920 10000 09998 09991XGB 00193 00192 00085 00007 00000 00000 05344 10000 10000 10000 09960

Table 18 Multiple comparison analysis between the F1 of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 07211 06670NB 00000 00000 00000 00136 00132 00099 08664RF 00000 00000 00000 00786 00016 00011 05162 10000LR 00000 00000 00000 00000 09440 09208 10000 05675 02181SVM 00000 00000 00000 00178 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00001 03138 02679 10000 09937 08849 09964 00000

Table 19 Multiple comparison analysis between the AUC of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 09999 10000RNN 09945 09985 10000LSTM 05273 06382 09259 09937GRU 08448 09102 09958 10000 10000CART 06921 05835 02356 00801 00014 00096NB 00002 00001 00000 00000 00000 00000 02616RF 00001 00001 00000 00000 00000 00000 02002 10000LR 00000 00000 00000 00000 00000 00000 00930 10000 10000SVM 00027 00014 00001 00000 00000 00000 06454 10000 09999 09980XGB 00000 00000 00000 00000 00000 00000 01257 10000 10000 10000 09993

the results are shown in Table 18The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 18 we can see that the F1 of MLP DBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms There is no significantdifference among traditionalML algorithms except SVM andthe F1 of SVM is significantly greater than that of all othertraditional ML algorithms

(5) Through the hypothesis test analysis of H5a and H5bwe can obtain p valuelt22e-16Therefore there are significantdifferences between theAUCof all trading algorithmsThere-fore we need to do further multiple comparative analysis andthe results are shown in Table 19 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 19 we can see that the AUC of all DNN models haveno significant difference There is no significant difference

Mathematical Problems in Engineering 15

Table 20 Multiple comparison analysis between the WR of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 04117MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00002 00006 00000LSTM 00000 00000 00000 00000 00000 09772GRU 00000 00000 00000 00000 00000 09911 10000CART 09931 00000 00000 00000 00000 00000 00000 00000NB 00031 00000 00001 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00205 06437 05358 00000 00000LR 00000 00000 00000 00000 00000 00010 01611 01105 00000 00000 10000SVM 00000 00000 00000 00000 00000 09914 10000 10000 00000 00000 05322 01090XGB 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000

Table 21Multiple comparison analysis between theARRof any two trading strategiesThepvalue of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00007MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 04790 06355 07182LSTM 00000 00000 02512 03806 04630 10000GRU 00000 00000 02235 03454 04249 10000 10000CART 00000 00000 08301 09217 09542 10000 09999 09998NB 00000 00000 10000 10000 10000 02920 01295 01125 06517RF 00000 00000 00020 00048 00076 08705 09735 09806 05393 00006LR 00000 00000 02058 03222 03995 10000 10000 10000 09996 01019 09845SVM 00000 00000 10000 00803 01114 09993 10000 10000 09659 00165 09999 10000XGB 00000 00000 10000 00333 00484 09916 09997 09998 08789 00057 10000 09999 10000

between the AUC of all traditional ML algorithms TheAUC of all traditional ML algorithms except for CART aresignificantly greater than that of any DNN model There isno significant difference among the AUC ofMLP SAE DBNRNN and CART

(6)Through the hypothesis test analysis of H6a and H6bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the WR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 20 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 20 we can see that the WR of BAH and benchmarkindex have no significant difference but they are significantlysmaller than that of anyML algorithmTheWRofMLPDBNand SAE are significantly smaller than that of the other trad-ing algorithms but there is no significant difference betweenthe WR of MLP DBN and SAE The WR of LSTM andGRU have no significant difference but they are significantlysmaller than that of XGB and significantly greater than that of

CART and NB In traditional MLmodels the WR of NB andCART are significantly smaller than that of other algorithmsThe WR of XGB is significantly greater than that of all otherML algorithms

(7)Through the analysis of the hypothesis test of H7a andH7b we obtain p valuelt22e-16

Therefore there are significant differences between theARR of all trading strategies including the benchmark indexand BAH strategy Therefore we need to do further multiplecomparative analysis and the results are shown in Table 21FromTables 14 and 21 we can see that ARR of the benchmarkindex and BAH are significantly smaller than that of alltrading algorithms The ARR of MLP is significantly higherthan that of RF but there is no significant difference betweenMLP and other algorithms The ARR of SAE and DBN aresignificantly higher than that of RF and XGB but they arenot significantly different fromARR of other algorithms TheARR of NB is significantly higher than that of RF SVMand XGB But otherwise there is no significant difference

16 Mathematical Problems in Engineering

Table 22Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 08877MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 09099 08862 08114LSTM 00000 00000 03460 03080 02239 09999GRU 00000 00000 02132 01853 01270 09981 10000CART 00000 00000 00158 00195 00327 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000 00000 07298RF 00000 00000 10000 10000 10000 09968 07444 05789 00018 00000LR 00000 00000 01181 01003 00650 09879 10000 10000 00000 00000 04044SVM 00000 00000 10000 10000 10000 09849 05952 04238 00042 00000 10000 02704XGB 00000 00000 09937 09902 09746 10000 09878 09532 00001 00000 10000 08723 09998

Table 23 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00006DBN 00000 00004 10000SAE 00000 00023 10000 10000RNN 00000 00000 00320 00421 00111LSTM 00000 00000 00002 00003 00000 09947GRU 00000 00000 00001 00001 00000 09767 10000CART 00000 00000 01238 01538 00521 10000 09241 08305NB 00000 01875 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 01180 01469 00493 10000 09298 08401 10000 00000LR 00000 00000 00001 00002 00000 09881 10000 10000 08821 00000 08898SVM 00000 00000 03285 03839 01701 09999 07011 05424 10000 00000 10000 06216XGB 00000 00000 00308 00405 00106 10000 09951 09783 10000 00000 10000 09890 09998

between any other two algorithms Therefore the ARR ofmost traditional ML models are not significantly worse thanthat of the best DNNmodel

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore There are significantdifferences betweenASRof all trading strategies including thebenchmark index and BAH strategy The results of multiplecomparative analysis are shown in Table 22 From Tables 14and 22 we can see that the ASR of the benchmark indexand BAH are significantly smaller than that of all tradingalgorithms The ASR of all ML algorithms are significantlyhigher than that of CART and NB but there is no significantdifference between the ASR of CART and NB Beyond thatthere is no significant difference between any other twoalgorithms Therefore the ASR of all traditional ML modelsexcept NB and CART are not significantly worse than that ofany DNNmodel

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between the MDD of these trading strategies

including the benchmark index and the BAH strategyThe results of multiple comparative analysis are shown inTable 23 From Tables 14 and 23 we can see that the MDDof the benchmark index is significantly smaller than that ofother trading strategies including BAH strategy TheMDD ofBAH is significantly greater than that of all trading algorithmsexcept NBTheMDDofMLPDBN and SAE are significantlylower than that of NB but significantly higher than thatof RNN LSTM GRU LR and XGB The MDD of NB issignificantly greater than that of all other trading algorithmsBeyond that there is no significant difference between anyother two algorithms Therefore all ML algorithms expectNB especially LSTM RNN GRU LR and XGB can play arole in controlling trading risk

In a word some DNN models such as MLP DBN andSAE have good performance in AR PR and F1 traditionalML algorithms such as LR and XGB have good performanceinAUCandWRTheARRof some traditionalML algorithmssuch as CART NB LR and SVM are not significantlydifferent from that of the six DNN models The ASR of the

Mathematical Problems in Engineering 17

six DNN algorithms are not significantly different from alltraditional ML models except NB and CART The MDD ofLR and XGB are significantly smaller than those of MLPDBN and SAE and are not significantly different fromthat of LSTM GRU and RNN The ARR and ASR of allML algorithms are significantly greater than those of BAHand benchmark index the MDD of all ML algorithms aresignificantly smaller than that of the benchmark index butsignificantly greater than that of BAH strategy

From the above analysis and evaluation we can see thatthe directional evaluation indicators of some DNN modelsare very competitive in CSICS while the indicators of sometraditional ML algorithms have excellent performance inSPICS Whether in SPICS or CSICS the ARR and ASR ofall ML algorithms are significantly greater than that of thebenchmark index and BAH strategy respectively In all MLalgorithms there are always some traditional ML algorithmswhich are not significantly worse than the best DNN modelfor any performance evaluation indicator (ARR ASR andMDD)Therefore if we do not consider transaction cost andother factors affecting trading performance of DNN modelsare alternative but not the best choice when they are appliedto stock trading

In the same period the ARR of any ML algorithm inCSICS is significantly greater than that of the same algorithmin SPICS (p valuelt0001 in theNemenyi test)Meanwhile theMDD of any ML algorithm in CSICS is significantly greaterthan that of the same algorithm in SPICS (p value lt0001in the Nemenyi test) The results show that the quantitativetrading algorithms can more easily obtain excess returns inthe Chinese A-share market but the volatility risk of tradingin Chinese A-share market is significantly higher than that ofthe US stock market in the past 8 years

6 The Impact of Transaction Cost onPerformance of ML Algorithms

Trading cost can affect the profitability of a stock tradingstrategy Transaction cost that can be ignored in long-termstrategies is significantly magnified in daily trading Howevermany algorithmic trading studies assume that transactioncost does not exist ([10 17] etc) In practice frictions suchas transaction cost can distort the market from the perfectmodel in textbooks The cost known prior to trading activityis referred to as transparent such as commissions exchangefees and taxes The costs that has to be estimated are knownas implicit including comprise bid-ask spread latency orslippage and related market impact This section focuses onthe transparent and implicit cost and how do they affecttrading performance in daily trading

61 Experimental Settings and Backtesting Algorithm In thispart the transparent transaction cost is calculated by a certainpercentage of transaction turnover for convenience theimplicit transaction cost is very complicated in calculationand it is necessary to make a reasonable estimate for therandom changes of market environment and stock pricesTherefore we only discuss the impact of slippage on tradingperformance

The transaction cost structures of American stocks aresimilar to that of Chinese A-shares We assume that transpar-ent transaction cost is calculated by a percentage of turnoversuch as less than 05 [40 41] and 02 and 05 in theliterature [42] It is different for the estimation of slippage

In some quantitative trading simulation software such asJoinQuant [43] and Abuquant [44] the slippage is set to 002The transparent transaction cost and implicit transaction costare charged in both directions when buying and selling Itis worth noting that the transparent transaction cost varieswith the different brokers while the implicit transaction costis related to market liquidity market information networkstatus trading software etc

We set slippages s = s0=0 s1=001 s2=002 s3=003s4=004 the transparent transaction cost c = c0=0 c1=0001c2=0002 c3=0003 c4=0004 c5=0005 For different s ccombinations we study the impact of different transactioncost structures on trading performance We assume thatbuying and selling positions are one unit so the turnover isthe corresponding stock price When buying stocks we notonly need to pay a certain percentage cost of the purchaseprice but also need to pay an uncertain slippage cost Thatis we need to pay a higher price than the real-time price119875119905minus1

when we are buying But when selling stocks we notonly need to pay a certain percentage cost of the sellingprice but also to pay an uncertain slippage cost Generallyspeaking we need to sell at a price lower than the real-timeprice 119875

119905 It is worth noting that our trading strategy is self-

financing If ML algorithms predict the continuous occur-rence of buying signals or selling signals ie |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 0 we will continue to hold or do nothingso the transaction cost at this time is 0 when |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 1 it is indicated that the position maybe changed from holding to selling or from empty positionto buying At this time we would pay transaction costdue to the trading operation Finally we get a real yieldis

119877119890119905119905le119862119897119900119904119890119875119903119894119888119890

119905minus 119862119897119900119904119890119875119903119894119888119890

119905minus1

119862119897119900119904119890119875119903119894119888119890119905minus1

119875119905= 119862119897119900119904119890119875119903119894119888119890

119905

lowast (1 minus 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816)

minus 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816

119875119905minus1

= 119862119897119900119904119890119875119903119894119888119890119905minus1

lowast (1 + 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816)

+ 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816

119877119890119905119905=119875119905minus 119875119905minus1

119875119905minus1

(5)

where 119862119897119900119904119890119875119903119894119888119890119905

denotes the 119905-th closing price119879119903119886119889119890119878119894119892119899119886119897

119905denotes the 119905-th trading signal 119875

119905denotes

the 119905-th executing price and 119877119890119905119905denotes the 119905-th return rate

We propose a backtesting algorithm with transaction costbased on the above analysis as is shown in Algorithm 3

18 Mathematical Problems in Engineering

Input TS TS is trading signals of a stocks s is slippagec c is transparent transaction cost

Output WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) WR=NULL ARR=NULL ASR=NULL MDD=NULL(3) for (i in 1 N) (4) Stock Data=Stock Code List[i](5) ClosePricet=Stock Data [ldquoClosing Pricerdquo](6) Pt =ClosePricet lowast(1-clowastabs(TSt-TSt-1)) - slowastabs(TSt-TSt-1)(7) Pt-1 =ClosePricetlowast(1+clowastabs(TSt-TSt-1)) + slowastabs(TSt-TSt-1)(8) Rett= (Pt- Pt-1) Pt Ret is the return rate series(9) TDRR=lag (TS)lowastRet TDRR is the daily return through trading(10) WR[i]=sum (TDRRgt0)sum(TDRR =0)(11) ARR[i]=Returnannualized (TDRR)(12) ASR[i]=SharpeRatioannualized (TDRR)(13) MDD[i]=maxDrawDown (TDRR)(14) WR=c (WR WR[i])(15) ARR=c (ARR ARR[i])(16) ASR=c (ASR ASR[i])(17) MDD=c (MDD MDD[i])(18) (19) return (WR ARR ASR MDD)

Algorithm 3 Backtesting algorithm with transaction cost in R language

62 Analysis of Impact of Transaction Cost on the TradingPerformance of SPICS Transaction cost is one of the mostimportant factors affecting trading performance In US stocktrading transparent transaction cost can be charged accord-ing to a fixed fee per order or month or a floating fee basedon the volume and turnover of each transaction Sometimescustomers can also negotiate with broker to determinetransaction cost The transaction cost charged by differentbrokers varies greatly Meanwhile implicit transaction costis not known beforehand and the estimations of them arevery complex Therefore we assume that the percentageof turnover is the transparent transaction cost for ease ofcalculation In the aspect of implicit transaction cost we onlyconsider the impact of slippage on trading performance

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 24 WR is decreasing with the increase oftransaction cost for any trading algorithm which is intuitiveWhen the transaction cost is set to (s c) = (004 0005) theWR of each algorithm is the lowest Compared with setting(s c) = (0 0) the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR and SVM to XGB are reduced by580 597 591 1583 1804 1395 2171 16042216 1854 1850 and 2597 respectively ThereforeMLP DBN and SAE are more tolerant to transaction costGenerally speaking the DNN models have stronger capacityto accommodate transaction cost than the traditional MLmodels From the single trading algorithm such as MLP ifwe do not consider slippage ie s=0 the average WR ofMLP is 05510 under transaction cost structures (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not considertransparent transaction cost ie c=0 the averageWRofMLP

is 05618 under transaction cost structures (s1 c0) (s2 c0)(s3 c0) (s4 c0) so transparent transaction cost has greaterimpact than slippageThroughmultiple comparative analysisthe WR under the transaction cost structure (s1 c0) is notsignificantly different from the WR without transaction costfor MLP DBN and SAETheWR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the WR under the transaction cost structure (s1 c0) (s2 c0) are not significantly different from theWRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 25 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the lowest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 4031 4157 and 4093 respectivelywhile the ARR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin accounts For a general setting of s and c ie (s c) = (0020003) ARR of MLP DBN and SAE decrease by 23262400 and 2361 respectively while the ARR of otheralgorithms decrease by more than 50 and that of CARTand XGB decrease bymore than 100ThereforeMLP DBNand SAE are more tolerant to high transaction cost Fromsingle trading algorithm such as RNN if we do not considerslippage ie s=0 the average ARR of RNN is 01434 under

Mathematical Problems in Engineering 19

Table24Th

eWRof

SPICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

05676

05680

05683

05843

05825

05844

05266

05930

05912

05859

05831

05891

(s0c1)

05615

05618

05621

05669

05626

05694

05052

05752

05663

05654

05630

05599

(s0c2)

05560

05560

05564

05507

05442

05553

04847

05585

05429

05463

05438

05324

(s0c3)

05507

05506

05510

05353

05269

05418

04652

05424

05205

05278

05253

05061

(s0c4)

05457

05454

05460

05206

05101

05289

044

7005277

04996

05105

05084

04818

(s0c5)

05410

05407

05412

05071

04946

05170

04303

05138

04803

04947

04924

04594

(s1c0)

056

49056

53056

5605778

05751

05785

05190

058

61058

2405782

05759

05788

(s1c1)

05594

05597

05600

05619

05571

05648

04991

05700

05597

05595

05574

05521

(s1c2)

05539

05539

05544

05458

05389

05508

04788

05534

05364

05406

05383

05249

(s1c3)

05487

05486

05491

05305

05215

05375

04597

05375

05141

05223

05200

04988

(s1c4)

05438

05436

05441

05163

05052

05249

044

1805231

04938

05054

05034

04750

(s1c5)

05394

05390

05396

05032

04902

05132

04255

05097

04751

04900

04880

04532

(s2c0)

05628

05631

05635

05729

056

9705741

05134

058

1105758

05726

05704

05713

(s2c1)

05573

05574

05578

05568

05515

05602

04931

05647

05527

05535

05515

05442

(s2c2)

05518

05518

05523

05408

05336

05463

04729

05482

05297

05349

05326

05172

(s2c3)

05469

05467

05472

05260

05164

05334

04543

05330

05082

05171

05150

04918

(s2c4)

05421

05417

05423

05120

05004

05209

04368

05187

04881

05004

04986

046

85(s2c5)

05377

05373

05379

04993

04858

05096

04209

05055

04699

04855

04835

044

73(s3c0)

05606

05609

05612

05678

05640

05694

05074

05759

05690

05668

05646

05635

(s3c1)

05552

05553

05558

05518

05460

05556

04872

05595

05460

05478

05459

05365

(s3c2)

05499

05498

05503

05362

05284

05422

046

7505434

05233

05295

05273

05099

(s3c3)

05450

05448

05453

05216

05114

05292

04491

05284

05020

05120

05098

04849

(s3c4)

05405

05401

05407

05080

04960

05172

04321

05146

04827

04959

04940

04622

(s3c5)

05362

05357

05363

04955

04816

05063

04166

05017

04651

04815

04793

044

17(s4c0)

05587

05589

05593

05630

05588

05652

05019

05710

05627

05613

05593

05562

(s4c1)

05533

05533

05537

05470

05407

05513

04815

05544

05395

05424

05404

05290

(s4c2)

05480

05479

05484

05316

05232

05380

04620

05386

05171

05242

05220

05026

(s4c3)

05432

05429

05435

05172

05067

05253

044

4005241

04964

05070

05051

04782

(s4c4)

05388

05384

05391

05041

04917

05137

04274

05106

04775

04914

04897

04564

(s4c5)

05347

05341

05347

04918

04774

05029

04123

04979

046

0204773

04752

04361

20 Mathematical Problems in Engineering

Table25Th

eARR

ofSP

ICSford

ailytradingwith

different

transactioncost

Ther

esultthatthere

isno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

03332

03296

03325

02943

02920

02934

03317

02975

03133

02942

03067

03041

(s0c1)

03128

030

8703118

02439

02327

02521

02266

02496

02384

02336

02400

02137

(s0c2)

02924

02879

02912

01936

01735

02108

01216

02017

01636

01731

01734

01234

(s0c3)

02721

02672

02706

01433

0114

301697

00168

01539

00889

01126

01070

00333

(s0c4)

02519

02464

02500

00931

00553

01285

-00878

01062

00143

00522

004

06-00567

(s0c5)

02316

02257

02294

00430

-00037

00875

-019

2400586

-00602

-0008

-00257

-014

66(s1c0)

03249

03212

03242

027

7802729

02794

029

53028

18028

9802747

028

5502762

(s1c1)

03046

03004

03035

02274

02136

02381

01902

02339

02149

02141

02188

01859

(s1c2)

02842

02796

02829

01771

01544

01969

00853

01861

01401

01536

01523

00957

(s1c3)

02639

02588

02623

01269

00953

01557

-00195

01383

00654

00931

00858

000

56(s1c4)

02437

02381

02417

00767

00363

0114

6-012

41009

06-00091

00328

00195

-00844

(s1c5)

02234

02174

02211

00266

-00226

00735

-02285

00430

-00836

-00275

-0046

8-01742

(s2c0)

03167

03129

03159

026

1302538

026

54025

89026

61026

6302551

026

43024

84(s2c1)

02964

02921

02952

02110

01946

02241

01539

02182

01914

01946

01977

01581

(s2c2)

0276

02713

02746

01607

01354

01829

00490

01704

0116

701341

01312

006

79(s2c3)

02557

02505

02540

0110

400763

01418

-00557

01227

004

2000737

006

47-00221

(s2c4)

02355

02298

02334

006

0300173

01007

-016

0300750

-00325

00134

-00016

-01120

(s2c5)

02153

02091

02129

00102

-00416

00597

-0264

700274

-010

69-00469

-00678

-02018

(s3c0)

030

85030

46030

7602448

02348

02514

02225

02504

02428

02356

02431

02206

(s3c1)

02881

02838

02869

01945

01756

02102

0117

502026

01680

01751

01765

01304

(s3c2)

02678

02630

02663

01442

01164

01690

00127

01548

00933

0114

601100

004

02(s3c3)

02476

02422

02457

00940

00574

01279

-00919

01071

00187

00543

00436

-00498

(s3c4)

02273

02215

02252

00439

-00016

00868

-019

6400595

-00558

-0006

-00227

-013

97(s3c5)

02071

02008

02047

-00062

-0060

5004

58-0300

800119

-013

02-00662

-00889

-02294

(s4c0)

03003

02962

02993

02284

02157

02374

01862

02348

02193

02161

02219

01929

(s4c1)

02799

02754

02786

01781

01565

01962

00813

01870

01445

01556

01554

01026

(s4c2)

02597

02547

02580

01278

00974

01551

-00235

01392

00699

00952

00889

00125

(s4c3)

02394

02339

02375

00776

00384

0114

0-012

8100915

-0004

700349

00226

-00774

(s4c4)

02192

02132

02169

00275

-00205

00729

-02326

00439

-00792

-00254

-00437

-016

73(s4c5)

01989

01926

01964

-00225

-00794

00319

-033

69-00037

-015

35-00856

-010

99-02570

Mathematical Problems in Engineering 21

the transaction cost structures (s0 c1) (s0 c2) (s0 c3) (s0c4) (s0 c5) if we do not consider transparent transactioncost ie c=0 the average ARR of RNN is 02531 under thetransaction cost structure (s1 c0) (s2 c0) (s3 c0) (s4c0) so transparent transaction cost has greater impact thanslippage Through multiple comparative analysis the ARRunder the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s0 c1) are not significantly different from the ARRwithout transaction cost for MLP DBN and SAE the ARRunder all other transaction cost structures are significantlysmaller than theARRwithout transaction cost For all tradingalgorithms except for MLP DBN and SAE the ARR underthe transaction cost structures (s1 c0) (s2 c0) are notsignificantly different from the ARR without transactioncost the ARR under all other transaction cost structures aresignificantly smaller than the ARR without transaction cost

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 26 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theASR of each algorithm is the lowest Compared with settingwithout transaction cost the ASR of MLP DBN and SAEreduce by 3997 4123 and 4066 respectively while theASR of other trading algorithms reduce by more than 90compared with the case of no transaction cost Thereforeexcessive transaction cost will significantly reduce ASR Fora general setting of s and c ie (s c) = (002 0003) theASR of MLP DBN and SAE decrease by 2262 2336and 2302 respectively while the ASR of other algorithmsdecrease by more than 50 the ASR of CART and XGBdecrease by more than 100Therefore MLP DBN and SAEare more tolerant to transaction cost From single tradingalgorithm such as NB if we do not consider slippage ies=0 the average ASR of NB is 08052 under the transactioncost structure (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5)if we do not consider transparent transaction cost ie c=0the average ASR of NB is 14182 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has greater impact than slippage Throughmultiple comparative analysis the ASR under the transactioncost structures (s1 c0) (s2 c0) (s3 c0) (s0 c1) are notsignificantly different from the ASR without transaction costfor MLP DBN and SAE the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the ASR under the transaction cost structures(s1 c0) (s2 c0) are not significantly different from the ASRwithout transaction cost the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 27 MDD increases with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the settings without transaction cost theMDD of MLP DBN and SAE increase by 932 1108 and

1032 respectively The MDD of other trading algorithmsincrease by more than 80 compared with those withoutconsidering transaction costTherefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 483 580 and 533respectively while the MDD of other algorithms increase bymore than 35 and theMDDofCART RF andXGB increasebymore than 100Therefore MLP DBN and SAE are moretolerant to transaction cost As awhole theDNNmodels havestronger capacity to accommodate transaction cost than thetraditional ML models From single trading algorithm suchas GRU if we do not consider slippage ie s=0 the averageMDD of GRU is 04459 under the transaction cost structures(s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do notconsider transparent transaction cost ie c=0 the averageMDD of GRU is 03559 under the transaction cost structures(s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparent transactioncost has greater impact than slippage Through multiplecomparative analysis the MDD under any the transactioncost structure is not significantly different from the MDDwithout transaction cost for MLP DBN and SAE For alltrading algorithms except for MLP DBN and SAE such asLR the MDD under the transaction cost structures (s0 c1)(s1 c0) (s2 c0) (s3 c0) are not significantly different fromthe MDD without transaction cost the MDD under all othertransaction cost structures are significantly greater than theMDD without transaction cost

Through the analysis of the Table 27 performance eval-uation indicators we find that trading performance afterconsidering transaction cost will be worse than that withoutconsidering transaction cost as is in actual trading situationIt is noteworthy that the performance changes of DNNalgorithms especially MLP DBN and SAE are very smallafter considering transaction cost This shows that the threealgorithms have good tolerance to changes of transactioncost Especially for the MDD of the three algorithms thereis no significant difference with that with no transactioncost So we can consider applying them in actual tradingMeanwhile we conclude that the transparent transactioncost has greater impact on the trading performances thanthe slippage for SPICS This is because the prices of SPICSare too high when the transparent transaction cost is setto a certain percentage of turnover In actual transactionsspecial attention needs to be paid to the fact that the trans-action performance under most transaction cost structuresis significantly lower than the trading performance withoutconsidering transaction cost It is worth noting that theperformance of traditional ML algorithm is not worse thanthat ofDNNalgorithmswithout considering transaction costwhile the performance of DNN algorithms is better than thatof traditional ML algorithms after considering transactioncost

63 Analysis of Impact of Transaction Cost on the TradingPerformance of CSICS Similar to Section 62 we will discussthe impact of transaction cost on trading performance ofCSICS in the followings In the Chinese A-share marketthe transparent transaction cost is usually set to a certain

22 Mathematical Problems in Engineering

Table26Th

eASR

ofSP

ICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

1546

815

412

15502

15764

15571

15828

13927

16237

16763

15818

16018

16298

(s0c1)

1456

214

478

14577

1300

012

317

13565

09346

13554

12650

12472

12456

11294

(s0c2)

13639

13527

13635

10191

09015

11262

04657

10822

08482

09074

08846

06236

(s0c3)

12702

12561

12679

07355

05690

08929

-00085

08061

04298

05652

05216

0118

2(s0c4)

11751

11581

11709

04511

02366

06580

-04823

05291

00139

02234

01596

-03812

(s0c5)

1079

10591

10728

01678

-00931

04227

-09500

02534

-039

59-01152

-019

87-08696

(s1c0)

15121

1505

715

149

1492

714

606

15119

1244

915

424

1558

214

825

14974

1488

6(s1c1)

14208

14116

14217

12146

11334

12841

07823

12722

1144

711459

11394

09859

(s1c2)

13279

13159

13270

09325

08020

10526

03105

09977

07267

08048

07772

04792

(s1c3)

12337

12188

12308

064

8204690

08185

-016

4607209

03082

04622

04139

-00257

(s1c4)

11382

11204

11333

03637

01368

05831

-06374

04438

-010

6801208

00524

-052

31(s1c5)

10417

10210

10348

00807

-019

2003478

-110

2501686

-05146

-02169

-0304

7-10083

(s2c0)

1477

1469

914

792

1408

113

632

1440

310

946

1460

114

390

1382

213

922

1346

2(s2c1)

13851

13752

13854

11285

10343

12111

06283

11883

10237

10439

10325

08416

(s2c2)

12916

12789

12901

08454

07021

09785

01547

09128

060

4907019

06696

03346

(s2c3)

11969

11812

11934

05607

03688

07437

-032

0506355

01868

03591

03063

-016

90(s2c4)

11010

10825

10955

02763

00372

05081

-07916

03586

-02268

00183

-00545

-06639

(s2c5)

1004

109827

09967

-0006

-02905

02729

-12533

00841

-06323

-031

79-04101

-114

54(s3c0)

14415

14337

14432

13227

12650

13679

09425

13770

13189

12810

12862

12030

(s3c1)

13490

13384

13488

10419

09348

11375

04733

11039

09023

09413

09252

06971

(s3c2)

12551

12416

12529

07580

060

19090

40-00013

08275

04832

05988

05618

01904

(s3c3)

11599

11435

11558

04731

02688

066

88-04757

05500

00658

02562

01988

-031

16(s3c4)

10636

10443

10575

01891

-00620

04331

-0944

202735

-0346

0-00836

-016

08-08034

(s3c5)

09664

09443

09584

-00924

-03883

01982

-14018

000

00-074

89-04183

-05146

-12808

(s4c0)

14058

13972

1406

812

368

11662

12950

07892

12933

11983

11793

11796

10591

(s4c1)

13127

13013

13119

09549

08350

10634

03180

10190

07807

08386

08177

05527

(s4c2)

12183

1204

12155

06705

05018

08293

-015

6807421

03617

04958

04542

004

68(s4c3)

11226

11055

11179

03857

01691

05938

-06295

046

47-00545

01537

00918

-04529

(s4c4)

1026

1006

10193

01021

-016

0703582

-10948

01888

-0464

2-018

49-02665

-09413

(s4c5)

09286

09057

09199

-017

83-04853

01238

-15478

-00836

-0864

2-05177

-06182

-14142

Mathematical Problems in Engineering 23

Table 27 The MDD of SPICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 03583 03584 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338(s0 c1) 03629 03638 03594 03779 03986 03636 04072 03712 03843 03963 03972 04203(s0 c2) 03677 03695 03647 04302 04707 03968 05168 04127 04842 04729 04787 05735(s0 c3) 03727 03756 03703 04990 05639 04376 06564 04709 06172 05682 05844 07335(s0 c4) 03781 03821 03764 05767 06612 04873 07804 05424 07377 06653 06913 08447(s0 c5) 03839 03890 03828 06529 0746 05444 08730 06162 08272 07501 07808 09118(s1 c0) 03596 03600 03560 03500 036130 03446 03574 03502 03414 03585 03569 03540(s1 c1) 03642 03655 03609 03907 04156 03717 04320 03814 04067 04154 04170 04541(s1 c2) 03691 03712 03662 04466 04936 04066 05534 04270 05172 04971 05049 06168(s1 c3) 03742 03774 03720 05183 05895 04495 06928 04885 06499 05937 06129 07662(s1 c4) 03796 03839 03781 05961 06842 05013 08105 05610 07631 06884 07161 08649(s1 c5) 03856 03909 03847 0671 07646 05595 08946 06342 08451 07691 0800 09235(s2 c0) 03609 03615 03573 03607 03756 03517 03770 03586 03586 03739 03727 03787(s2 c1) 03656 03671 03623 04047 04349 03805 04627 03929 04339 04365 04397 04929(s2 c2) 03705 03729 03678 04642 05176 04171 05916 04424 05504 05218 05327 06577(s2 c3) 03756 03792 03736 05377 06143 04624 07277 05067 06805 06183 06402 07939(s2 c4) 03812 03859 03799 06155 07056 05161 08380 05796 07856 07099 07388 08816(s2 c5) 03873 03930 03866 06887 07816 05751 09126 06517 08606 07864 08172 09331(s3 c0) 03622 03631 03588 03729 03912 03594 04004 03685 03795 03909 03909 04081(s3 c1) 03669 03687 03639 04200 04555 03901 04966 04062 04622 04587 04642 05334(s3 c2) 03719 03746 03694 04826 05423 04286 06295 04589 05833 05465 05607 06936(s3 c3) 03772 03811 03754 05572 06377 04762 07609 05248 07081 06420 06657 08175(s3 c4) 03829 03879 03818 06341 07254 05314 08620 05980 08054 07300 07593 08956(s3 c5) 03894 03954 03888 07056 07972 05909 09275 06689 08740 08022 08325 09412(s4 c0) 03635 03647 03602 03861 04082 03678 04274 03798 04015 04096 04114 04396(s4 c1) 03683 03704 03654 04362 04774 04005 05325 04211 04908 04814 04894 05730(s4 c2) 03734 03765 03712 05013 05664 04410 06667 04758 06142 05707 05875 07253(s4 c3) 03790 03833 03775 05765 06600 04905 07906 05429 07330 06644 06894 08375(s4 c4) 03851 03904 03841 06521 07439 05470 08824 06162 08230 07485 07782 09074(s4 c5) 03917 03981 03913 07218 08115 06067 09395 06857 08858 08165 08463 09480

percentage of turnover and it is the same as the assumptionin the experimental settings As in the US stock market thesmallest unit of price change is 001 (one tick) It is reasonableto set slippage to be 001-005 Of course it should be notedthat the prices fluctuation may be more intense when closingthan that in the middle of a trading day

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 28 the WR is decreasing with the increaseof transaction cost for any trading algorithm When thetransaction cost is set to (s c) = (004 0005) the WR of eachalgorithm is the smallest Comparedwith the settings withouttransaction cost the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR SVM and XGB are reduced by671 688 697 2269 1726 1548 2430 14912484 2112 2112 and 2919 respectively For a generalsetting of s and c ie (s c) = (002 0003) the WR ofMLP DBN and SAE decrease by 410 420 and 430respectively while the WR of other algorithms decrease bymore than 9 the WR of CART RF and XGB decrease by

more than 15 Therefore MLP DBN and SAE are moretolerant to transaction cost From single trading algorithmsuch as LSTM if we do not consider slippage ie s=0 theaverage WR of DBN is 05417 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage WR of LSTM is 05304 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the WR under the transactioncost structures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the WR without transaction cost for MLPDBN SAE and NB the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN SAE and NB the WR under the transaction coststructure (s0 c1) is not significantly different from the WRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

24 Mathematical Problems in Engineering

Table 28 The WR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803(s0 c1) 05523 05527 05525 05525 05608 05620 05009 05227 05612 05665 05571 05595(s0 c2) 05488 05492 05489 05389 05512 05535 04879 05149 05460 05542 05445 05411(s0 c3) 05453 05456 05452 05258 05414 05451 04747 05068 05313 05418 05320 05234(s0 c4) 05417 05419 05414 05127 05320 05368 04622 04991 05172 05297 05202 05067(s0 c5) 05383 05383 05379 05004 05230 05286 04504 04917 05036 05180 05088 04905(s1 c0) 05494 05499 05497 05444 05541 05558 04925 05170 05520 05584 05492 05488(s1 c1) 05456 05459 05456 05286 05424 05456 04775 05080 05342 05437 05345 05275(s1 c2) 05421 05423 05420 05161 05335 05377 04654 05007 05207 05320 05231 05110(s1 c3) 05386 05388 05383 05036 05246 05296 04530 04931 05065 05205 05116 04946(s1 c4) 05353 05354 05349 04915 05156 05218 04419 04861 04937 05095 05007 04795(s1 c5) 05323 05323 05317 04808 05076 05148 04315 04796 04817 04995 04905 04652(s2 c0) 05431 05434 05431 05219 05368 05403 04707 05036 05269 05374 05286 05189(s2 c1) 05395 05397 05393 05078 05266 05314 04573 04956 05115 05242 05154 05005(s2 c2) 05360 05361 05357 04960 05181 05237 04458 04886 04985 05134 05046 04853(s2 c3) 05331 05331 05326 04850 05100 05167 04352 04818 04864 05031 04945 04711(s2 c4) 05300 05300 05293 04743 05018 05093 04252 04752 04746 04931 04846 04572(s2 c5) 05273 05271 05266 04648 04946 05029 04159 04692 04639 04838 04755 04445(s3 c0) 05373 05374 05371 05019 05216 05265 04514 04917 05049 05186 05098 04932(s3 c1) 05341 05341 05336 04902 05128 05188 04399 04846 04917 05074 04990 04775(s3 c2) 05312 05312 05306 04798 05052 05122 04303 04782 04804 04977 04896 04644(s3 c3) 05281 05281 05275 04696 04976 05049 04206 04718 04689 04879 04799 04509(s3 c4) 05252 05251 05245 04598 04901 04984 04110 04657 04581 04785 04707 04378(s3 c5) 05226 05223 05218 04510 04833 04924 04023 04602 04481 04701 04621 04264(s4 c0) 05325 05325 05321 04860 05089 05150 04360 04816 04870 05030 04949 04723(s4 c1) 05294 05294 05289 04753 05010 05079 04258 04750 04752 04928 04849 04588(s4 c2) 05266 05265 05259 04653 04937 05013 04164 04690 04642 04838 04761 04458(s4 c3) 05238 05236 05230 04562 04864 04948 04073 04632 04541 04747 04672 04336(s4 c4) 05211 05208 05203 04475 04798 04891 03985 04577 04440 04662 04586 04218(s4 c5) 05186 05182 05176 04392 04733 04832 03901 04524 04348 04582 04509 04109

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 29 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the smallest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 5073 5175 and 5225 respectivelyWhile the ARR of other trading algorithms decrease bymore than 100 compared with those algorithms withouttransaction cost Therefore excessive transaction cost canlead to serious losses in the accounts For a general settingof s and c ie (s c) = (002 0003) ARR of MLP DBNand SAE decrease by 2741 2797 and 2825 respectivelywhile the ARR other algorithms decrease by more than 50and that of CART NB RF and XGB decrease by more than100 Therefore MLP DBN and SAE are more tolerant totransaction cost From single trading algorithm such as SAEif we do not consider slippage ie s=0 the average ARR ofSAE is 05040 under the transaction cost structure (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not consider

transparent transaction cost ie c=0 the averageARRof SAEis 04468 under the transaction cost structures (s1 c0) (s2c0) (s3 c0) (s4 c0) so transparent transaction cost hassmaller impact than slippage Through multiple comparativeanalysis the ARR under the transaction cost structures (s0c1) (s0 c2) (s0 c3) (s0 c1) (s1 c1) are not significantlydifferent from the ARR without transaction cost for MLPDBN and SAE the ARR under all other transaction coststructures are significantly smaller than the ARR withouttransaction cost For RNN LSTM GRU CART RF LR andSVM the ARR under the transaction cost structures (s0c1) (s0 c2) (s1 c0) are not significantly different fromthe ARR without transaction cost the ARR under all othertransaction cost structures are significantly smaller than theARR without transaction cost For NB and XGB the ARRunder the transaction cost structures (s0 c1) (s1 c0) arenot significantly different from the ARR without transactioncost the ARR under all other transaction cost structuresare significantly smaller than the ARR without transactioncost

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 3: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

Mathematical Problems in Engineering 3

1 Data Acquisition

Data Source

Soware

2 Data Preparation

EX RightDividend

Feature Generation

Data Normalization

3 LearningAlgorithm

Machine LearningAlgorithms

Walk-ForwardTrainingPrediction

Algorithm Design ofTrading Signals

4 PerformanceCalculation

DirectionalEvaluation Indicators

PerformanceEvaluation Indicators

Back-testingAlgorithms

5 e ExperimentalResults

Statistical TestingMethod

Trading Evaluationwithout Transaction

Cost

Trading Evaluationwith Transaction Cost

Figure 1 The framework for predicting stock price trends based on ML algorithms

most suitable algorithm from these ML algorithms for stocktrading both in the US stock market and the Chinese A-sharemarket

The remainder of this paper is organized as followsSection 2 describes the architecture of this work Section 3gives the parameter settings of these ML models and thealgorithm for generating trading signals based on the MLmodels mentioned in this paper Section 4 gives the direc-tional evaluation indicators performance evaluation indi-cators and backtesting algorithms Section 5 uses nonpa-rameter statistical test methods to analyze and evaluate theperformance of these different algorithms in the twomarketsSection 6 gives the analysis of impact of transaction coston performance of ML algorithms for trading Section 7gives some discussions of differences in trading performanceamong different algorithms from the perspective of dataalgorithms transaction cost and suggestions for algorithmictrading Section 8 provides a comprehensive conclusion andfuture research directions

2 Architecture of the Work

The general framework of predicting the future price trendsof stocks trading process and backtesting based on MLalgorithms is shown in Figure 1 This article is organizedfrom data acquisition data preparation intelligent learningalgorithm and trading performance evaluation In this studydata acquisition is the first step Where should we get dataand what software should we use to get data quickly andaccurately are something that we need to consider In thispaper we use R language to do all computational proceduresMeanwhile we obtain SPICS and CSICS from Yahoo financeand Netease Finance respectively Secondly the task ofdata preparation includes ex-dividendrights for the acquireddata generating a large number of well-recognized technicalindicators as features and using max-min normalization todeal with the features so that the preprocessed data canbe used as the input of ML algorithms [34] Thirdly thetrading signals of stocks are generated by the ML algorithmsIn this part we train the DNN models and the traditional

ML algorithms by a WFA method then the trained MLmodels will predict the direction of the stocks in a futuretime which is considered as the trading signal Fourthly wegive some widely used directional evaluation indicators andperformance evaluation indicators and adopt a backtestingalgorithm for calculating the indicators Finally we use thetrading signal to implement the backtesting algorithm ofstock daily trading strategy and then apply statistical testmethod to evaluate whether there are statistical significantdifferences among the performance of these trading algo-rithms in both cases of transaction cost and no transactioncost

3 ML Algorithms

31 ML Algorithms and Their Parameter Settings Given atraining dataset D the task of ML algorithm is to classifyclass labels correctly In this paper we will use six traditionalML models (LR SVM CART RF BN and XGB) and sixDNN models (MLP DBN SAE RNN LSTM and GRU) asclassifiers to predict the ups and downs of the stock prices[34] Themain model parameters and training parameters ofthese ML learning algorithms are shown in Tables 1 and 2

InTables 1 and 2 features and class labels are set accordingto the input format of various ML algorithms in R languageMatrix (m n) represents amatrix withm rows and n columnsArray (p m n) represents a tensor and each layer of thetensor is Matrix (m n) and the height of the tensor is p c(h1 h2 h3 ) represents a vector where the length of thevector is the number of hidden layers and the 119894-th elementof c is the number of neurons of the 119894-th hidden layer Inthe experiment 119898 = 250 represents that we use the data ofthe past 250 trading days as training samples in each roundof WFA 119899 = 44 represents that the data of each day has 44features In Table 2 the parameters of DNN models such asactivation function learning rate batch size and epoch areall default values in the algorithms of R programs

32WFAMethod WFA [35] is a rolling training methodWeuse the latest data instead of all past data to train the model

4 Mathematical Problems in Engineering

Table 1 Main parameter settings of traditional ML algorithms

Input Features Label Main parametersLR Matrix(25044) Matrix(2501) A specification for the model link function is logitSVM Matrix(25044) Matrix(2501) The kernel function used is Radial Basis kernel Cost of constraints violation is 1CART Matrix(25044) Matrix(2501) The maximum depth of any node of the final tree is 20 The splitting index can be Gini coefficientRF Matrix(25044) Matrix(2501) The Number of trees is 500 Number of variables randomly sampled as candidates at each split is 7BN Matrix(25044) Matrix(2501) the prior probabilities of class membership is the class proportions for the training setXGB Matrix(25044) Matrix(2501) The maximum depth of a tree is 10 the max number of iterations is 15 the learning rate is 03

Table 2 Main parameter settings of DNN algorithms

Input Features Label Learning rate Dimensions of hidden layers Activation function Batch size EpochMLP Matrix(25044) Matrix(2501) 08 c(2515105) sigmoid 100 3DBN Matrix(25044) Matrix(2501) 08 c(2515105) sigmoid 100 3SAE Matrix(25044) Matrix(2501) 08 c(20105) sigmoid 100 3RNN Array(125044) Array(12501) 001 c(105) sigmoid 1 1LSTM Array(125044) Array(12501) 001 c(105) sigmoid 1 1GRU Array(125044) Array(12501) 001 c(105) sigmoid 1 1

and then apply the trainedmodel to implement the predictionfor the out-of-sample data (testing dataset) of the future timeperiod After that a new training set which is the previoustraining set walk one step forward is carried out the trainingof the next round WFA can improve the robustness and theconfidence of the trading strategy in real-time trading

In this paper we useML algorithms and theWFAmethodto do stock price trend predictions as trading signals In eachstep we use the data from the past 250 days (one year) as thetraining set and the data for the next 5 days (one week) asthe test set Each stock contains data of 2000 trading daysso it takes (2000-250)5 = 350 training sessions to produce atotal of 1750 predictions which are the trading signals of dailytrading strategy TheWFAmethod is as shown in Figure 2

33 The Algorithm Design of Trading Signal In this part weuseML algorithms as classifiers to predict the ups and downsof the stock in SPICS and CSICS and then use the predictionresults as trading signals of daily trading We use the WFAmethod to train each ML algorithm We give the generatingalgorithm of trading signals according to Figure 2 which isshown in Algorithm 1

4 Evaluation Indicators andBacktesting Algorithm

41 Directional Evaluation Indicators In this paper we useML algorithms to predict the direction of stock price sothe main task of the ML algorithms is to classify returnsTherefore it is necessary for us to use directional evaluationindicators to evaluate the classification ability of these algo-rithms

The actual label values of the dataset are sequences ofsets DOWN UP Therefore there are four categories ofpredicted label values and actual label values which areexpressed as TU FU FD and TD TU denotes the number ofUP that the actual label values are UP and the predicted label

Table 3 Confusion matrix of two classification results of MLalgorithm

Predicted label valuesUP DOWN

Actual label values UP TU FDDOWN FU TD

values are also UP FU denotes the number of UP that theactual label values are DOWN but the predicted label valuesare UP TD denotes the number of DOWN that the actuallabel values are DOWN and the predicted label values areDOWN FD denotes the number of DOWN that the actuallabel values are UP but the predicted label values are DOWNas shown in Table 3 Table 3 is a two-dimensional table calledconfusionmatrix It classifies predicted label values accordingto whether predicted label values match real label values Thefirst dimension of the table represents all possible predictedlabel values and the second dimension represents all real labelvalues When predicted label values equal real label valuesthey are correct classifications The correct prediction labelvalues lie on the diagonal line of the confusion matrix Inthis paper what we are concerned about is that when thedirection of stock price is predicted to be UP tomorrow webuy the stock at todayrsquos closing price and sell it at tomorrowrsquosclosing price when we predict the direction of stock price tobe DOWN tomorrow we do nothing So UP is a ldquopositiverdquolabel of our concern

In most of classification tasks AR is generally usedto evaluate performance of classifiers AR is the ratio ofthe number of correct predictions to the total number ofpredictions That is as follows

119860119877 =(119879119880 + 119879119863)

(119879119880 + 119865119863 + 119865119880 + 119879119863)(1)

Mathematical Problems in Engineering 5

ML Algorithm

44-dim

2000

-dim

44-dim

44-dim

44-dim

44-dim

44-dim

44-dim

250-

dim

5-di

m25

0-di

m5-

dim

250-

dim

5-di

m

1-dim

1-dim

1-dim

1-dim

5-di

m5-

dim

5-di

m

1750

-dim

ConcatenateML Algorithm

ML Algorithm

Raw

Inpu

t Dat

a

Figure 2The schematic diagram of WFA (training and testing)

Input Stock SymbolsOutput Trading Signals(1) N=Length of Stock Symbols(2) L=Length of Trading Days(3) P=Length of Features(4) k= Length of Training Dataset for WFA(5) n= Length of Sliding Window for WFA(6) for (i in 1 N) (7) Stock=Stock Symbols[i](8) M=(L-k)n(9) Trading Signal=NULL(10) for (j in 1M) (11) Dataset= Stock[(k+nlowast(j-1))(k+n+nlowast(j-1)) 1(P+1)](12) Train=Dataset[1k1(1+P)](13) Test= Dataset[(k+1)(k+n)1P](14) Model=ML Algorithm(Train)(15) Probability=Model(Test)(16) if (Probabilitygt=05) (17) Trading Signal0=1(18) else (19) Trading Signal0=0(20) (21) (22) Trading Signal=c (Trading Signal Trading Signal0)(23) (24) return (Trading Signal)

Algorithm 1 Generating trading signal in R language

6 Mathematical Problems in Engineering

In this paper ldquoUPrdquo is the profit source of our tradingstrategiesThe classification ability ofML algorithm is to eval-uate whether the algorithms can recognize ldquoUPrdquo Thereforeit is necessary to use PR and RR to evaluate classificationresults These two evaluation indicators are initially appliedin the field of information retrieval to evaluate the relevanceof retrieval results

PR is a ratio of the number of correctly predicted UP toall predicted UP That is as follows

119875119877 =119879119880

(119879119880 + 119865119880)(2)

High PR means that ML algorithms can focus on ldquoUPrdquorather than ldquoDOWNrdquo

RR is the ratio of the number of correctly predicted ldquoUPrdquoto the number of actually labeled ldquoUPrdquo That is as follows

119875119877 =119879119880

(119879119880 + 119865119863)(3)

High RR can capture a large number of ldquoUPrdquo and beeffectively identified In fact it is very difficult to present analgorithm with high PR and RR at the same time Thereforeit is necessary to measure the classification ability of theML algorithm by using some evaluation indicators whichcombine PR with RR F1-Score is the harmonic average ofPR and AR F1 is a more comprehensive evaluation indicatorThat is as follows

1198651= 2 lowast 119875119877 lowast

119860119877

(119875119877 + 119860119877)(4)

Here it is assumed that theweights of PR andRR are equalwhen calculating F1 but this assumption is not always correctIt is feasible to calculate F1 with different weights for PR andRR but determining weights is a very difficult challenge

AUC is the area under ROC (Receiver Operating Charac-teristic) curve ROC curve is often used to check the tradeoffbetween finding TU and avoiding FU Its horizontal axisis FU rate and its vertical axis is TU rate Each point onthe curve represents the proportion of TU under differentFU thresholds [36] AUC reflects the classification ability ofclassifier The larger the value the better the classificationability It is worth noting that two different ROC curves maylead to the same AUC value so qualitative analysis should becarried out in combination with the ROC curve when usingAUCvalue In this paper we use R language package ldquoROCRrdquoto calculate AUC

42 Performance Evaluation Indicator Performance evalua-tion indicator is used for evaluating the profitability and riskcontrol ability of trading algorithms In this paper we usetrading signals generated by ML algorithms to conduct thebacktesting and apply the WR ARR ASR and MDD to dothe trading performance evaluation [34] WR is a measureof the accuracy of trading signals ARR is a theoretical rateof return of a trading strategy ASR is a risk-adjusted returnwhich represents return from taking a unit risk [37] and therisk-free return or benchmark is set to 0 in this paper MDDis the largest decline in the price or value of the investmentperiod which is an important risk assessment indicator

43 Backtesting Algorithm Using historical data to imple-ment trading strategy is called backtesting In research andthe development phase of trading model the researchersusually use a new set of historical data to do backtesting Fur-thermore the backtesting period should be long enoughbecause a large number of historical data can ensure that thetrading model can minimize the sampling bias of data Wecan get statistical performance of tradingmodels theoreticallyby backtesting In this paper we get 1750 trading signals foreach stock If tomorrowrsquos trading signal is 1 we will buy thestock at todayrsquos closing price and then sell it at tomorrowrsquosclosing price otherwise we will not do stock trading Finallywe get AR PR RR F1 AUC WR ARR ASR and MDD byimplementing backtesting algorithm based on these tradingsignals

5 Comparative Analysis ofDifferent Trading Algorithms

51 Nonparametric Statistical Test Method In this part weuse the backtesting algorithm(Algorithm 2) to calculate theevaluation indicators of different trading algorithms In orderto test whether there are significant differences betweenthe evaluation indicators of different ML algorithms thebenchmark indexes and the BAH strategies it is necessaryto use analysis of variance and multiple comparisons to givethe answers Therefore we propose the following nine basichypotheses for significance test in which Hja (119895 = 1 2 3 45 6 7 8 9) are the null hypothesis and the correspondingalternative assumptions areHjb (119895 = 1 2 3 4 5 6 7 8 9)Thelevel of significance is 005

For any evaluation indicator 119895 isin 119860119877 119875119877 119877119877 1198651 119860119880119862119882119877119860119877119877 119860119878119877119872119863119863 and any trading strategy 119894 isin 119872119871119875119863119861119873 119878119860119864 119877119873119873 119871119878119879119872 119866119877119880 119871119877 119878119881119872 119873119861119862119860119877119879 119877119865119883119866119861119861119860119867 119861119890119899119888ℎ119898119886119903119896 119894119899119889119890119909 the null hypothesis a is Hjaalternative hypotheses b is Hjb (119895 = 1 2 3 4 5 6 7 8 9represent AR PR RR F1 AUC WR ARR ASR MDDrespectively)

Hja the evaluation indicator j of all strategies are thesameHjb the evaluation indicator j of all strategies are notthe same

It is worth noting that any evaluation indicator of alltrading algorithm or strategy does not conform to the basichypothesis of variance analysisThat is it violates the assump-tion that the variances of any two groups of samples are thesame and each group of samples obeys normal distributionTherefore it is not appropriate to use t-test in the analysisof variance and we should take the nonparametric statisticaltest method instead In this paper we use the Kruskal-Wallisrank sum test [38] to carry out the analysis of variance If thealternative hypothesis is established we will need to furtherapply the Nemenyi test [39] to do the multiple comparisonsbetween trading strategies

52 Comparative Analysis of Performance of Different TradingStrategies in SPICS Table 4 shows the average value of

Mathematical Problems in Engineering 7

Input TS TS is trading signals of a stockOutput AR PR RR F1 AUC WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) Bt=Benchmark Index [ldquoClosing Pricerdquo] B is the closing price of benchmark index(3) WR=NULL ARR=NULL ASR=NULL MDD=NULL(4) for (i in 1 N) (5) Stock Data=Stock Code List[i](6) Pt=Stock Data [ldquoClosing Pricerdquo](7) Labelt= Stock Data [ldquoLabelrdquo](8) BDRRt=(Bt-Bt-1) Bt-1 BDRR is the daily return rate of benchmark index(9) DRRt= (Pt-Pt-1)Pt-1 DRR is daily return rateThat is daily return rate of BAH strategy(10) TDRRt=lag (TSt)lowastDRRt TDRR is the daily return through trading(11) Table=Confusion Matrix(TS Label)(12) AR[i]=sum(adj(Table))sum(Table)(13) PR[i]=Table[2 2]sum(Table[ 2])(14) RR[i]=Table[2 2]sum(Table[2 ])(15) F1=2lowastPR[i]lowastRR[i](PR[i]+RR[i])(16) Pred=prediction (TS Label)(17) AUC[i]=performance (Pred measure=ldquoaucrdquo)yvalues[[1]](18) WR[i]=sum (TDRRgt0)sum(TDRR =0)(19) ARR[i]=Returnannualized (TDRR) TDRR BDRR or DRR can be used(20) ASR[i]=SharpeRatioannualized (TDRR) TDRR BDRR or DRR can be used(21) MDD[i]=maxDrawDown (TDRR) TDRR BDRR or DRR can be used(22) AR=c (AR AR[i])(23) PR=c (PR PR[i])(24) RR=c (RR RR[i])(25) F1=c (F1 F1[i])(26) AUC=c (AUC AUC[i])(27) WR=c (WR WR[i])(28) ARR=c (ARR ARR[i])(29) ASR=c (ASR ASR[i])(30) MDD=c (MDD MDD[i])(31) (32) Performance=cbind (AR PR RR F1 AUC WR ARR ASR MDD)(33) return (Performance)

Algorithm 2 Backtesting algorithm of daily trading strategy in R language

Table 4 Trading performance of different trading strategies in the SPICS Best performance of all trading strategies is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGBAR mdash mdash 05205 05189 05201 05025 05013 04986 06309 05476 06431 06491 06235 06600PR mdash mdash 07861 07764 07781 05427 05121 04911 06514 05270 06595 06474 06733 06738RR mdash mdash 05274 05263 05273 05245 05253 05239 06472 05762 06599 06722 06325 06767F1 mdash mdash 06258 06217 06229 05332 05183 05065 06491 05480 06595 06591 06517 06751AUC mdash mdash 05003 05001 05002 04997 05005 04992 06295 05489 06418 06491 06199 06590WR 05450 05235 05676 05680 05683 05843 05825 05844 05266 05930 05912 05859 05831 05891ARR 01227 01603 03333 03298 03327 02945 02921 02935 03319 02976 03134 02944 03068 03042ASR 08375 06553 15472 15415 15506 15768 15575 15832 13931 16241 16768 15822 16022 16302MDD 01939 04233 03584 03585 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338

various trading algorithms in AR PR RR F1 AUC WRARR ASR and MDD We can see that the AR RR F1 andAUC of XGB are the greatest in all trading algorithms TheWR of NB is the greatest in all trading strategies The ARRof MLP is the greatest in all trading strategies including thebenchmark index (SampP 500 index) and BAH strategy TheASR of RF is the greatest in all trading strategies TheMDDofthe benchmark index is the smallest in all trading strategies

It is worth noting that the ARR and ASR of all ML algorithmsare greater than those of BAH strategy and the benchmarkindex

(1) Through the hypothesis test analysis of H1a and H1bwe can obtain p valuelt22e-16

Therefore there are statistically significant differencesbetween the AR of all trading algorithms Therefore we needto make multiple comparative analysis further as shown in

8 Mathematical Problems in Engineering

Table 5Multiple comparison analysis between theAR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 10000GRU 00000 00000 00000 08273 09811CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00232 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 07649SVM 00000 00000 00000 00000 00000 00000 06057 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00002 02010 00000

Table 6Multiple comparison analysis between the PR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 09999SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00034GRU 00000 00000 00000 00000 01472CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 07869 05786 00000 00000RF 00000 00000 00000 00000 00000 00000 08056 00000LR 00000 00000 00000 00000 00000 00000 09997 00000 02626SVM 00000 00000 00000 00000 00000 00000 00008 00000 03104 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00491 00000 09999

Table 5 The number in the table is a p value of any two algo-rithms of Nemenyi test When p valuelt005 we think thatthe two trading algorithms have a significant differenceotherwise we cannot deny the null assumption that the meanvalues of AR of the two algorithms are equal From Tables 5and 4 we can see that the AR of all DNN models are signif-icantly lower than those of all traditional MLmodelsTheARof MLP DBN and SAE are significantly greater than those ofRNN LSTM and GRU There are no significant differencesamong the AR of MLP DBN and SAE There are no sig-nificant differences among the AR of RNN LSTM and GRU

(2) Through the hypothesis test analysis of H2a and H2bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between the PR of all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 6 The number in the table is a pvalue of any two algorithms of Nemenyi test From Tables 6and 4 we can see that the PR of MLP DBN and SAE aresignificantly greater than that of other trading algorithmsThe PR of LSTM is not significantly different from that ofGRU and NBThe PR of GRU is significantly lower than thatof all traditional ML algorithms The PR of NB is significantlylower than that of other traditional ML algorithms

(3) Through the hypothesis test analysis of H3a and H3bwe can obtain p valuelt22e-16 So there are statistically

significant differences between the RR of all trading algo-rithms Therefore we need to make multiple comparativeanalysis further as shown in Table 7 The number in thetable is a p value of any two algorithms of Nemenyi testFrom Tables 7 and 4 we can see that there is no significantdifference among the RR of all DNN models but the RRof any DNN model is significantly lower than that of alltraditional ML models The RR of NB is significantly lowerthan that of other traditional ML algorithms The RR ofCART is significantly lower than that of other traditional MLalgorithms except for NB

(4) Through the hypothesis test analysis of H4a and H4bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between the F1 of all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 8 The number in the table is a pvalue of any two algorithms of Nemenyi test From Tables8 and 4 we can see that there is no significant differenceamong the F1 of MLP DBN and SAE The F1 of MLP DBNand SAE are significantly greater than that of RNN LSTMGRU andNB but are significantly smaller than that of RF LRSVM and XGBThe F1 of GRU and LSTMhave no significantdifference but they are significantly smaller than that of alltraditional ML algorithms The F1 of XGB is significantlygreater than that of all other trading algorithms

Mathematical Problems in Engineering 9

Table 7Multiple comparison analysis between the RR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 10000 10000 10000LSTM 10000 10000 10000 10000GRU 09999 10000 09999 10000 10000CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00485 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 00555SVM 00000 00000 00000 00000 00000 00000 00197 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00010 09958 00000

Table 8Multiple comparison analysis between the F1 of any two trading algorithms The p value of the two trading strategies with significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 09998SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00810GRU 00000 00000 00000 00000 03489CART 00861 00061 00117 00000 00000 00000NB 00000 00000 00000 04635 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00078 00000LR 00000 00000 00000 00000 00000 00000 00173 00000 10000SVM 00007 00000 00000 00000 00000 00000 09797 00000 03336 04825XGB 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000

Table 9 Multiple comparison analysis between the AUC of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 10000 10000 10000LSTM 10000 10000 10000 09999GRU 10000 10000 10000 10000 09975CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00270 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 05428SVM 00000 00000 00000 00000 00000 00000 03125 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00002 03954 00000

(5) Through the hypothesis test analysis of H5a and H5bwe can obtain p valuelt22e-16 So there are statisticallysignificant differences between the AUC of all trading algo-rithms Therefore we need to make multiple comparativeanalysis further as shown in Table 9 The number in thetable is a p value of any two algorithms of Nemenyi testFrom Tables 9 and 4 we can see that there is no significantdifference among the AUC of all DNN models The AUC of

all DNN models are significantly smaller than that of anytraditional ML model

(6) Through the hypothesis test analysis of H6a and H6bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between theWRof all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 10 The number in the table is pvalue of any two algorithms of Nemenyi test From Tables 4

10 Mathematical Problems in Engineering

Table10M

ultip

lecomparis

onanalysisbetweentheW

Rof

anytwotradingalgorithm

sTh

epvalueo

fthe

twotradingstr

ategiesw

ithsig

nificantd

ifference

isin

boldface

Index

BAH

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

BAH

000

00MLP

000

00000

00DBN

000

00000

0010

000

SAE

000

00000

0010

000

1000

0RN

N000

00000

00000

00000

00000

00LSTM

000

00000

00000

00000

00000

0009974

GRU

000

11000

00000

01000

00000

0010

000

09961

CART

000

0009998

000

00000

00000

00000

00000

00000

00NB

000

00000

00000

00000

00000

00000

31000

00000

38000

00RF

000

00000

00000

00000

00000

0000118

000

0100140

000

0010

000

LR000

00000

00000

00000

00000

0010

000

08508

1000

0000

00004

320117

7SV

M000

00000

00000

00000

00000

0010

000

1000

010

000

000

00000

01000

0609780

XGB

000

00000

00000

00000

00000

0002660

000

8402927

000

0009831

09989

07627

00376

Mathematical Problems in Engineering 11

Table 11Multiple comparison analysis between theARRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00001 00006 00001LSTM 00000 00000 00000 00002 00000 10000GRU 00000 00000 00001 00008 00001 10000 10000CART 00000 00000 10000 10000 10000 00001 00000 00001NB 00000 00000 00021 00094 00022 10000 09998 10000 00018RF 00000 00000 07978 09524 08036 01685 00874 01962 07745 05861LR 00000 00000 00002 00012 00002 10000 10000 10000 00002 10000 02408SVM 00000 00000 02375 04806 02427 07029 05214 07457 02178 09778 09999 08015XGB 00000 00000 00674 01856 00694 09423 08466 09576 00600 09996 09905 09739 10000

Table 12Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 09667MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 08763 07617 08998LSTM 00000 00000 09922 09701 09949 10000GRU 00000 00000 06124 04563 06537 10000 09996CART 00000 00000 00002 00005 00002 00000 00000 00000NB 00000 00000 00467 00233 00557 09529 07037 09971 00000RF 00000 00000 00000 00000 00000 00291 00042 01062 00000 08010LR 00000 00000 07506 06025 07859 10000 10000 10000 00000 09872 00602SVM 00000 00000 01759 01020 02010 09982 09399 10000 00000 10000 04671 09998XGB 00000 00000 00099 00044 00122 07548 03776 09470 00000 10000 09681 08791 09997

and 10 we can see that the WR of MLP DBN and SAE haveno significant difference but they are significantly higherthan that of BAH and benchmark index and significantlylower than that of other trading algorithms TheWR of RNNLSTM and GRU have no significant difference but they aresignificantly higher than that of CART and significantly lowerthan that of NB and RF The WR of LR is not significantlydifferent from that of RF SVM and XGB

(7) Through the analysis of the hypothesis test of H7aand H7b we obtain p valuelt22e-16 Therefore there aresignificant differences between the ARR of all trading strate-gies including the benchmark index and BAH We needto do further multiple comparative analysis as shown inTable 11 From Tables 4 and 11 we can see that the ARR ofthe benchmark index and BAH are significantly lower thanthat of all ML algorithms The ARR of MLP DBN and SAEare significantly greater than that of RNN LSTM GRU NBand LR but not significantly different from that of CARTRF SVM and XGB there is no significant difference betweenthe ARR of MLP DBN and SAE The ARR of RNN LSTM

and GRU are significantly less than that of CART but theyare not significantly different from that of other traditionalML algorithms In all traditional ML algorithms the ARR ofCART is significantly greater than that of NB and LR butotherwise there is no significant difference between ARR ofany other two algorithms

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore there are significantdifferences between ASR of all trading strategies includingthe benchmark index and BAH The results of our multiplecomparative analysis are shown in Table 12 From Tables 4and 12 we can see that the ASR of the benchmark index andBAH are significantly smaller than that of all ML algorithmsThe ASR of MLP and DBN are significantly greater than thatof CART and are significantly smaller than that of NB RFand XGB but there is no significant difference between MLPDBN and other algorithms The ASR of SAE is significantlygreater than that of CART and significantly less than that ofRF and XGB but there is no significant difference betweenSAE and other algorithms The ASR of RNN and LSTM

12 Mathematical Problems in Engineering

Table 13 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00052DBN 00000 00031 10000SAE 00000 00012 10000 10000RNN 00000 00000 01645 02243 03556LSTM 00000 00000 06236 07173 08511 10000GRU 00000 00000 00245 00381 00760 10000 09860CART 00000 00000 01496 02057 03309 10000 10000 10000NB 00000 00000 00786 01136 01999 10000 09994 10000 10000RF 00000 00000 00002 00004 00012 08964 04248 09980 09109 09713LR 00000 00000 05451 06428 07935 10000 10000 09933 10000 09998 05015SVM 00000 00000 02433 03194 04734 10000 10000 09999 10000 10000 08155 10000XGB 00000 00000 00103 00167 00360 09998 09462 10000 09999 10000 09998 09685 09989

Table 14 Trading performance of different trading strategies in CSICS Best performance of all trading strategies is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGBAR mdash mdash 05175 05167 05163 05030 04993 04993 05052 05084 05090 05084 05112 05087PR mdash mdash 07548 07436 07439 05414 04964 04956 05022 05109 05128 04967 05695 05026RR mdash mdash 05252 05250 05248 05234 05224 05223 05279 05307 05311 05318 05295 05315F1 mdash mdash 06150 06108 06108 05320 05086 05082 05143 05192 05214 05132 05483 05164AUC mdash mdash 05027 05024 05020 05006 04995 04996 05049 05078 05082 05086 05074 05085WR 05222 05090 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803ARR 00633 02224 05731 05704 05678 05248 05165 05113 05534 06125 04842 05095 05004 04938ASR 02625 04612 14031 14006 13935 14880 15422 15505 12232 11122 14379 15582 14231 14698MDD 04808 06697 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632

are significantly greater than that of CART and significantlyless than that of RF but there is no significant differencebetweenRNN LSTM and other algorithmsTheASRofGRUis significantly greater than that of CART but there is nosignificant difference between GRU and other traditional MLalgorithms In all traditional ML algorithms the ASR of allalgorithms are significantly greater than that of CART butotherwise there is no significant difference between ASR ofany other two algorithms

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between MDD of trading strategies includingthe benchmark index and the BAH The results of multiplecomparative analysis are shown in Table 13 From Tables4 and 13 we can see that MDD of any ML algorithm issignificantly greater than that of the benchmark index butsignificantly smaller than that of BAH strategy The MDDof MLP and DBN are significantly smaller than those ofGRU RF and XGB but there is no significant differencebetween MLP DBN and other algorithms The MDD ofSAE is significantly smaller than that of XGB but there isno significant difference between SAE and other algorithmsOtherwise there is no significant difference betweenMDDofany other two algorithms

In a word the traditional ML algorithms such as NBRF and XGB have good performance in most directional

evaluation indicators such as AR PR and F1 The DNNalgorithms such as MLP have good performance in PR andARR In traditional ML algorithms the ARR of CART RFSVM and XGB are not significantly different from that ofMLP DBN and SAE the ARR of CART is significantlygreater than that of LSTM GRU and RNN but otherwisethe ARR of all traditional ML algorithms are not significantlyworse than that of LSTM GRU and RNN The ASR of alltraditional ML algorithms except CART are not significantlyworse than that of the six DNNmodels even the ASR of NBRF and XGB are significantly greater than that of some DNNalgorithms The MDD of RF and XGB are significantly lessthat of MLP DBN and SAE the MDD of all traditional MLalgorithms are not significantly different from that of LSTMGRU and RNNThe ARR and ASR of all ML algorithms aresignificantly greater than that of BAH and the benchmarkindex the MDD of any ML algorithm is significantly greaterthan that of the benchmark index but significantly less thanthat of BAH strategy

53 Comparative Analysis of Performance of Different TradingStrategies in CSICS The analysis methods of this part aresimilar to Section 52 From Table 14 we can see that the ARPR and F1 of MLP are the greatest in all trading algorithmsThe RR AUC WR and ASR of LR are the greatest inall trading algorithms respectively The ARR of NB is the

Mathematical Problems in Engineering 13

Table 15Multiple comparison analysis between theARof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 01857GRU 00000 00000 00000 04439 10000CART 00000 00000 00000 09765 00024 00131NB 00000 00001 00002 00022 00000 00000 01810RF 00000 00002 00005 00007 00000 00000 00941 10000LR 00000 00000 00000 00076 00000 00000 03454 10000 10000SVM 00217 00766 01309 00000 00000 00000 00003 08314 09352 06360XGB 00000 00001 00001 00025 00000 00000 01930 10000 10000 10000 08168

Table 16Multiple comparison analysis between the PRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 09906 09781NB 00000 00000 00000 00000 01716 01234 08940RF 00000 00000 00000 00000 00319 00205 05271 10000LR 00000 00000 00000 00000 10000 10000 09951 02099 00422SVM 00000 00000 00000 01157 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00000 09922 09811 10000 08836 05086 09960 00000

highest in all trading strategies The MDD of CSI 300 index(benchmark index) is the smallest in all trading strategiesTheWRARR and ASR of all ML algorithms are greater thanthose of the benchmark index and BAH strategy

(1) Through the hypothesis test analysis of H1a and H1bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the AR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 15The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 15 we can see that the AR ofMLPDBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms except for SVM The ARof GRU is significantly smaller than that of all traditional MLalgorithms There is no significant difference between the ARof any two traditional ML algorithms except for CART andSVM

(2) Through the hypothesis test analysis of H2a and H2bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the PR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 16 The number in the tableis a p value of any two algorithms of Nemenyi test FromTables 14 and 16 we can see that the PR of MLP DBN and

SAE are significantly greater than that of all other tradingalgorithms and the PR of MLP DBN and SAE have nosignificant difference The PR of SVM is significantly greaterthan that of all other traditional ML algorithms which haveno significant difference between any two algorithms exceptfor SVM The PR of RNN is significantly greater than thatof all traditional ML algorithms except for SVM The PR ofGRU and LSTM are not significantly different from that of alltraditional ML algorithms except for SVM and LR

(3) Through the hypothesis test analysis of H3a and H3bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the RR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 17 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 17 we can see that the RR of all DNN models arenot significantly different There is no significant differenceamong the RR of all traditional ML algorithms The RR ofRNN GRU and LSTM are significantly smaller than that ofany traditional ML algorithm except for CART

(4) Through the hypothesis test analysis of H4a and H4bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the F1 of all trading algorithms There-fore we need to do further multiple comparative analysis and

14 Mathematical Problems in Engineering

Table 17Multiple comparison analysis between the RRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 09996 09996 10000LSTM 09309 09314 09781 09999GRU 09660 09663 09916 10000 10000CART 09744 09742 09225 05809 01509 02138NB 01093 01088 00574 00075 00004 00007 08861RF 00537 00534 00260 00028 00001 00002 07544 10000LR 00330 00328 00152 00015 00001 00001 06498 10000 10000SVM 03444 03434 02170 00434 00033 00059 09920 10000 09998 09991XGB 00193 00192 00085 00007 00000 00000 05344 10000 10000 10000 09960

Table 18 Multiple comparison analysis between the F1 of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 07211 06670NB 00000 00000 00000 00136 00132 00099 08664RF 00000 00000 00000 00786 00016 00011 05162 10000LR 00000 00000 00000 00000 09440 09208 10000 05675 02181SVM 00000 00000 00000 00178 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00001 03138 02679 10000 09937 08849 09964 00000

Table 19 Multiple comparison analysis between the AUC of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 09999 10000RNN 09945 09985 10000LSTM 05273 06382 09259 09937GRU 08448 09102 09958 10000 10000CART 06921 05835 02356 00801 00014 00096NB 00002 00001 00000 00000 00000 00000 02616RF 00001 00001 00000 00000 00000 00000 02002 10000LR 00000 00000 00000 00000 00000 00000 00930 10000 10000SVM 00027 00014 00001 00000 00000 00000 06454 10000 09999 09980XGB 00000 00000 00000 00000 00000 00000 01257 10000 10000 10000 09993

the results are shown in Table 18The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 18 we can see that the F1 of MLP DBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms There is no significantdifference among traditionalML algorithms except SVM andthe F1 of SVM is significantly greater than that of all othertraditional ML algorithms

(5) Through the hypothesis test analysis of H5a and H5bwe can obtain p valuelt22e-16Therefore there are significantdifferences between theAUCof all trading algorithmsThere-fore we need to do further multiple comparative analysis andthe results are shown in Table 19 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 19 we can see that the AUC of all DNN models haveno significant difference There is no significant difference

Mathematical Problems in Engineering 15

Table 20 Multiple comparison analysis between the WR of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 04117MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00002 00006 00000LSTM 00000 00000 00000 00000 00000 09772GRU 00000 00000 00000 00000 00000 09911 10000CART 09931 00000 00000 00000 00000 00000 00000 00000NB 00031 00000 00001 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00205 06437 05358 00000 00000LR 00000 00000 00000 00000 00000 00010 01611 01105 00000 00000 10000SVM 00000 00000 00000 00000 00000 09914 10000 10000 00000 00000 05322 01090XGB 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000

Table 21Multiple comparison analysis between theARRof any two trading strategiesThepvalue of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00007MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 04790 06355 07182LSTM 00000 00000 02512 03806 04630 10000GRU 00000 00000 02235 03454 04249 10000 10000CART 00000 00000 08301 09217 09542 10000 09999 09998NB 00000 00000 10000 10000 10000 02920 01295 01125 06517RF 00000 00000 00020 00048 00076 08705 09735 09806 05393 00006LR 00000 00000 02058 03222 03995 10000 10000 10000 09996 01019 09845SVM 00000 00000 10000 00803 01114 09993 10000 10000 09659 00165 09999 10000XGB 00000 00000 10000 00333 00484 09916 09997 09998 08789 00057 10000 09999 10000

between the AUC of all traditional ML algorithms TheAUC of all traditional ML algorithms except for CART aresignificantly greater than that of any DNN model There isno significant difference among the AUC ofMLP SAE DBNRNN and CART

(6)Through the hypothesis test analysis of H6a and H6bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the WR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 20 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 20 we can see that the WR of BAH and benchmarkindex have no significant difference but they are significantlysmaller than that of anyML algorithmTheWRofMLPDBNand SAE are significantly smaller than that of the other trad-ing algorithms but there is no significant difference betweenthe WR of MLP DBN and SAE The WR of LSTM andGRU have no significant difference but they are significantlysmaller than that of XGB and significantly greater than that of

CART and NB In traditional MLmodels the WR of NB andCART are significantly smaller than that of other algorithmsThe WR of XGB is significantly greater than that of all otherML algorithms

(7)Through the analysis of the hypothesis test of H7a andH7b we obtain p valuelt22e-16

Therefore there are significant differences between theARR of all trading strategies including the benchmark indexand BAH strategy Therefore we need to do further multiplecomparative analysis and the results are shown in Table 21FromTables 14 and 21 we can see that ARR of the benchmarkindex and BAH are significantly smaller than that of alltrading algorithms The ARR of MLP is significantly higherthan that of RF but there is no significant difference betweenMLP and other algorithms The ARR of SAE and DBN aresignificantly higher than that of RF and XGB but they arenot significantly different fromARR of other algorithms TheARR of NB is significantly higher than that of RF SVMand XGB But otherwise there is no significant difference

16 Mathematical Problems in Engineering

Table 22Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 08877MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 09099 08862 08114LSTM 00000 00000 03460 03080 02239 09999GRU 00000 00000 02132 01853 01270 09981 10000CART 00000 00000 00158 00195 00327 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000 00000 07298RF 00000 00000 10000 10000 10000 09968 07444 05789 00018 00000LR 00000 00000 01181 01003 00650 09879 10000 10000 00000 00000 04044SVM 00000 00000 10000 10000 10000 09849 05952 04238 00042 00000 10000 02704XGB 00000 00000 09937 09902 09746 10000 09878 09532 00001 00000 10000 08723 09998

Table 23 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00006DBN 00000 00004 10000SAE 00000 00023 10000 10000RNN 00000 00000 00320 00421 00111LSTM 00000 00000 00002 00003 00000 09947GRU 00000 00000 00001 00001 00000 09767 10000CART 00000 00000 01238 01538 00521 10000 09241 08305NB 00000 01875 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 01180 01469 00493 10000 09298 08401 10000 00000LR 00000 00000 00001 00002 00000 09881 10000 10000 08821 00000 08898SVM 00000 00000 03285 03839 01701 09999 07011 05424 10000 00000 10000 06216XGB 00000 00000 00308 00405 00106 10000 09951 09783 10000 00000 10000 09890 09998

between any other two algorithms Therefore the ARR ofmost traditional ML models are not significantly worse thanthat of the best DNNmodel

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore There are significantdifferences betweenASRof all trading strategies including thebenchmark index and BAH strategy The results of multiplecomparative analysis are shown in Table 22 From Tables 14and 22 we can see that the ASR of the benchmark indexand BAH are significantly smaller than that of all tradingalgorithms The ASR of all ML algorithms are significantlyhigher than that of CART and NB but there is no significantdifference between the ASR of CART and NB Beyond thatthere is no significant difference between any other twoalgorithms Therefore the ASR of all traditional ML modelsexcept NB and CART are not significantly worse than that ofany DNNmodel

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between the MDD of these trading strategies

including the benchmark index and the BAH strategyThe results of multiple comparative analysis are shown inTable 23 From Tables 14 and 23 we can see that the MDDof the benchmark index is significantly smaller than that ofother trading strategies including BAH strategy TheMDD ofBAH is significantly greater than that of all trading algorithmsexcept NBTheMDDofMLPDBN and SAE are significantlylower than that of NB but significantly higher than thatof RNN LSTM GRU LR and XGB The MDD of NB issignificantly greater than that of all other trading algorithmsBeyond that there is no significant difference between anyother two algorithms Therefore all ML algorithms expectNB especially LSTM RNN GRU LR and XGB can play arole in controlling trading risk

In a word some DNN models such as MLP DBN andSAE have good performance in AR PR and F1 traditionalML algorithms such as LR and XGB have good performanceinAUCandWRTheARRof some traditionalML algorithmssuch as CART NB LR and SVM are not significantlydifferent from that of the six DNN models The ASR of the

Mathematical Problems in Engineering 17

six DNN algorithms are not significantly different from alltraditional ML models except NB and CART The MDD ofLR and XGB are significantly smaller than those of MLPDBN and SAE and are not significantly different fromthat of LSTM GRU and RNN The ARR and ASR of allML algorithms are significantly greater than those of BAHand benchmark index the MDD of all ML algorithms aresignificantly smaller than that of the benchmark index butsignificantly greater than that of BAH strategy

From the above analysis and evaluation we can see thatthe directional evaluation indicators of some DNN modelsare very competitive in CSICS while the indicators of sometraditional ML algorithms have excellent performance inSPICS Whether in SPICS or CSICS the ARR and ASR ofall ML algorithms are significantly greater than that of thebenchmark index and BAH strategy respectively In all MLalgorithms there are always some traditional ML algorithmswhich are not significantly worse than the best DNN modelfor any performance evaluation indicator (ARR ASR andMDD)Therefore if we do not consider transaction cost andother factors affecting trading performance of DNN modelsare alternative but not the best choice when they are appliedto stock trading

In the same period the ARR of any ML algorithm inCSICS is significantly greater than that of the same algorithmin SPICS (p valuelt0001 in theNemenyi test)Meanwhile theMDD of any ML algorithm in CSICS is significantly greaterthan that of the same algorithm in SPICS (p value lt0001in the Nemenyi test) The results show that the quantitativetrading algorithms can more easily obtain excess returns inthe Chinese A-share market but the volatility risk of tradingin Chinese A-share market is significantly higher than that ofthe US stock market in the past 8 years

6 The Impact of Transaction Cost onPerformance of ML Algorithms

Trading cost can affect the profitability of a stock tradingstrategy Transaction cost that can be ignored in long-termstrategies is significantly magnified in daily trading Howevermany algorithmic trading studies assume that transactioncost does not exist ([10 17] etc) In practice frictions suchas transaction cost can distort the market from the perfectmodel in textbooks The cost known prior to trading activityis referred to as transparent such as commissions exchangefees and taxes The costs that has to be estimated are knownas implicit including comprise bid-ask spread latency orslippage and related market impact This section focuses onthe transparent and implicit cost and how do they affecttrading performance in daily trading

61 Experimental Settings and Backtesting Algorithm In thispart the transparent transaction cost is calculated by a certainpercentage of transaction turnover for convenience theimplicit transaction cost is very complicated in calculationand it is necessary to make a reasonable estimate for therandom changes of market environment and stock pricesTherefore we only discuss the impact of slippage on tradingperformance

The transaction cost structures of American stocks aresimilar to that of Chinese A-shares We assume that transpar-ent transaction cost is calculated by a percentage of turnoversuch as less than 05 [40 41] and 02 and 05 in theliterature [42] It is different for the estimation of slippage

In some quantitative trading simulation software such asJoinQuant [43] and Abuquant [44] the slippage is set to 002The transparent transaction cost and implicit transaction costare charged in both directions when buying and selling Itis worth noting that the transparent transaction cost varieswith the different brokers while the implicit transaction costis related to market liquidity market information networkstatus trading software etc

We set slippages s = s0=0 s1=001 s2=002 s3=003s4=004 the transparent transaction cost c = c0=0 c1=0001c2=0002 c3=0003 c4=0004 c5=0005 For different s ccombinations we study the impact of different transactioncost structures on trading performance We assume thatbuying and selling positions are one unit so the turnover isthe corresponding stock price When buying stocks we notonly need to pay a certain percentage cost of the purchaseprice but also need to pay an uncertain slippage cost Thatis we need to pay a higher price than the real-time price119875119905minus1

when we are buying But when selling stocks we notonly need to pay a certain percentage cost of the sellingprice but also to pay an uncertain slippage cost Generallyspeaking we need to sell at a price lower than the real-timeprice 119875

119905 It is worth noting that our trading strategy is self-

financing If ML algorithms predict the continuous occur-rence of buying signals or selling signals ie |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 0 we will continue to hold or do nothingso the transaction cost at this time is 0 when |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 1 it is indicated that the position maybe changed from holding to selling or from empty positionto buying At this time we would pay transaction costdue to the trading operation Finally we get a real yieldis

119877119890119905119905le119862119897119900119904119890119875119903119894119888119890

119905minus 119862119897119900119904119890119875119903119894119888119890

119905minus1

119862119897119900119904119890119875119903119894119888119890119905minus1

119875119905= 119862119897119900119904119890119875119903119894119888119890

119905

lowast (1 minus 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816)

minus 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816

119875119905minus1

= 119862119897119900119904119890119875119903119894119888119890119905minus1

lowast (1 + 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816)

+ 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816

119877119890119905119905=119875119905minus 119875119905minus1

119875119905minus1

(5)

where 119862119897119900119904119890119875119903119894119888119890119905

denotes the 119905-th closing price119879119903119886119889119890119878119894119892119899119886119897

119905denotes the 119905-th trading signal 119875

119905denotes

the 119905-th executing price and 119877119890119905119905denotes the 119905-th return rate

We propose a backtesting algorithm with transaction costbased on the above analysis as is shown in Algorithm 3

18 Mathematical Problems in Engineering

Input TS TS is trading signals of a stocks s is slippagec c is transparent transaction cost

Output WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) WR=NULL ARR=NULL ASR=NULL MDD=NULL(3) for (i in 1 N) (4) Stock Data=Stock Code List[i](5) ClosePricet=Stock Data [ldquoClosing Pricerdquo](6) Pt =ClosePricet lowast(1-clowastabs(TSt-TSt-1)) - slowastabs(TSt-TSt-1)(7) Pt-1 =ClosePricetlowast(1+clowastabs(TSt-TSt-1)) + slowastabs(TSt-TSt-1)(8) Rett= (Pt- Pt-1) Pt Ret is the return rate series(9) TDRR=lag (TS)lowastRet TDRR is the daily return through trading(10) WR[i]=sum (TDRRgt0)sum(TDRR =0)(11) ARR[i]=Returnannualized (TDRR)(12) ASR[i]=SharpeRatioannualized (TDRR)(13) MDD[i]=maxDrawDown (TDRR)(14) WR=c (WR WR[i])(15) ARR=c (ARR ARR[i])(16) ASR=c (ASR ASR[i])(17) MDD=c (MDD MDD[i])(18) (19) return (WR ARR ASR MDD)

Algorithm 3 Backtesting algorithm with transaction cost in R language

62 Analysis of Impact of Transaction Cost on the TradingPerformance of SPICS Transaction cost is one of the mostimportant factors affecting trading performance In US stocktrading transparent transaction cost can be charged accord-ing to a fixed fee per order or month or a floating fee basedon the volume and turnover of each transaction Sometimescustomers can also negotiate with broker to determinetransaction cost The transaction cost charged by differentbrokers varies greatly Meanwhile implicit transaction costis not known beforehand and the estimations of them arevery complex Therefore we assume that the percentageof turnover is the transparent transaction cost for ease ofcalculation In the aspect of implicit transaction cost we onlyconsider the impact of slippage on trading performance

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 24 WR is decreasing with the increase oftransaction cost for any trading algorithm which is intuitiveWhen the transaction cost is set to (s c) = (004 0005) theWR of each algorithm is the lowest Compared with setting(s c) = (0 0) the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR and SVM to XGB are reduced by580 597 591 1583 1804 1395 2171 16042216 1854 1850 and 2597 respectively ThereforeMLP DBN and SAE are more tolerant to transaction costGenerally speaking the DNN models have stronger capacityto accommodate transaction cost than the traditional MLmodels From the single trading algorithm such as MLP ifwe do not consider slippage ie s=0 the average WR ofMLP is 05510 under transaction cost structures (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not considertransparent transaction cost ie c=0 the averageWRofMLP

is 05618 under transaction cost structures (s1 c0) (s2 c0)(s3 c0) (s4 c0) so transparent transaction cost has greaterimpact than slippageThroughmultiple comparative analysisthe WR under the transaction cost structure (s1 c0) is notsignificantly different from the WR without transaction costfor MLP DBN and SAETheWR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the WR under the transaction cost structure (s1 c0) (s2 c0) are not significantly different from theWRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 25 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the lowest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 4031 4157 and 4093 respectivelywhile the ARR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin accounts For a general setting of s and c ie (s c) = (0020003) ARR of MLP DBN and SAE decrease by 23262400 and 2361 respectively while the ARR of otheralgorithms decrease by more than 50 and that of CARTand XGB decrease bymore than 100ThereforeMLP DBNand SAE are more tolerant to high transaction cost Fromsingle trading algorithm such as RNN if we do not considerslippage ie s=0 the average ARR of RNN is 01434 under

Mathematical Problems in Engineering 19

Table24Th

eWRof

SPICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

05676

05680

05683

05843

05825

05844

05266

05930

05912

05859

05831

05891

(s0c1)

05615

05618

05621

05669

05626

05694

05052

05752

05663

05654

05630

05599

(s0c2)

05560

05560

05564

05507

05442

05553

04847

05585

05429

05463

05438

05324

(s0c3)

05507

05506

05510

05353

05269

05418

04652

05424

05205

05278

05253

05061

(s0c4)

05457

05454

05460

05206

05101

05289

044

7005277

04996

05105

05084

04818

(s0c5)

05410

05407

05412

05071

04946

05170

04303

05138

04803

04947

04924

04594

(s1c0)

056

49056

53056

5605778

05751

05785

05190

058

61058

2405782

05759

05788

(s1c1)

05594

05597

05600

05619

05571

05648

04991

05700

05597

05595

05574

05521

(s1c2)

05539

05539

05544

05458

05389

05508

04788

05534

05364

05406

05383

05249

(s1c3)

05487

05486

05491

05305

05215

05375

04597

05375

05141

05223

05200

04988

(s1c4)

05438

05436

05441

05163

05052

05249

044

1805231

04938

05054

05034

04750

(s1c5)

05394

05390

05396

05032

04902

05132

04255

05097

04751

04900

04880

04532

(s2c0)

05628

05631

05635

05729

056

9705741

05134

058

1105758

05726

05704

05713

(s2c1)

05573

05574

05578

05568

05515

05602

04931

05647

05527

05535

05515

05442

(s2c2)

05518

05518

05523

05408

05336

05463

04729

05482

05297

05349

05326

05172

(s2c3)

05469

05467

05472

05260

05164

05334

04543

05330

05082

05171

05150

04918

(s2c4)

05421

05417

05423

05120

05004

05209

04368

05187

04881

05004

04986

046

85(s2c5)

05377

05373

05379

04993

04858

05096

04209

05055

04699

04855

04835

044

73(s3c0)

05606

05609

05612

05678

05640

05694

05074

05759

05690

05668

05646

05635

(s3c1)

05552

05553

05558

05518

05460

05556

04872

05595

05460

05478

05459

05365

(s3c2)

05499

05498

05503

05362

05284

05422

046

7505434

05233

05295

05273

05099

(s3c3)

05450

05448

05453

05216

05114

05292

04491

05284

05020

05120

05098

04849

(s3c4)

05405

05401

05407

05080

04960

05172

04321

05146

04827

04959

04940

04622

(s3c5)

05362

05357

05363

04955

04816

05063

04166

05017

04651

04815

04793

044

17(s4c0)

05587

05589

05593

05630

05588

05652

05019

05710

05627

05613

05593

05562

(s4c1)

05533

05533

05537

05470

05407

05513

04815

05544

05395

05424

05404

05290

(s4c2)

05480

05479

05484

05316

05232

05380

04620

05386

05171

05242

05220

05026

(s4c3)

05432

05429

05435

05172

05067

05253

044

4005241

04964

05070

05051

04782

(s4c4)

05388

05384

05391

05041

04917

05137

04274

05106

04775

04914

04897

04564

(s4c5)

05347

05341

05347

04918

04774

05029

04123

04979

046

0204773

04752

04361

20 Mathematical Problems in Engineering

Table25Th

eARR

ofSP

ICSford

ailytradingwith

different

transactioncost

Ther

esultthatthere

isno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

03332

03296

03325

02943

02920

02934

03317

02975

03133

02942

03067

03041

(s0c1)

03128

030

8703118

02439

02327

02521

02266

02496

02384

02336

02400

02137

(s0c2)

02924

02879

02912

01936

01735

02108

01216

02017

01636

01731

01734

01234

(s0c3)

02721

02672

02706

01433

0114

301697

00168

01539

00889

01126

01070

00333

(s0c4)

02519

02464

02500

00931

00553

01285

-00878

01062

00143

00522

004

06-00567

(s0c5)

02316

02257

02294

00430

-00037

00875

-019

2400586

-00602

-0008

-00257

-014

66(s1c0)

03249

03212

03242

027

7802729

02794

029

53028

18028

9802747

028

5502762

(s1c1)

03046

03004

03035

02274

02136

02381

01902

02339

02149

02141

02188

01859

(s1c2)

02842

02796

02829

01771

01544

01969

00853

01861

01401

01536

01523

00957

(s1c3)

02639

02588

02623

01269

00953

01557

-00195

01383

00654

00931

00858

000

56(s1c4)

02437

02381

02417

00767

00363

0114

6-012

41009

06-00091

00328

00195

-00844

(s1c5)

02234

02174

02211

00266

-00226

00735

-02285

00430

-00836

-00275

-0046

8-01742

(s2c0)

03167

03129

03159

026

1302538

026

54025

89026

61026

6302551

026

43024

84(s2c1)

02964

02921

02952

02110

01946

02241

01539

02182

01914

01946

01977

01581

(s2c2)

0276

02713

02746

01607

01354

01829

00490

01704

0116

701341

01312

006

79(s2c3)

02557

02505

02540

0110

400763

01418

-00557

01227

004

2000737

006

47-00221

(s2c4)

02355

02298

02334

006

0300173

01007

-016

0300750

-00325

00134

-00016

-01120

(s2c5)

02153

02091

02129

00102

-00416

00597

-0264

700274

-010

69-00469

-00678

-02018

(s3c0)

030

85030

46030

7602448

02348

02514

02225

02504

02428

02356

02431

02206

(s3c1)

02881

02838

02869

01945

01756

02102

0117

502026

01680

01751

01765

01304

(s3c2)

02678

02630

02663

01442

01164

01690

00127

01548

00933

0114

601100

004

02(s3c3)

02476

02422

02457

00940

00574

01279

-00919

01071

00187

00543

00436

-00498

(s3c4)

02273

02215

02252

00439

-00016

00868

-019

6400595

-00558

-0006

-00227

-013

97(s3c5)

02071

02008

02047

-00062

-0060

5004

58-0300

800119

-013

02-00662

-00889

-02294

(s4c0)

03003

02962

02993

02284

02157

02374

01862

02348

02193

02161

02219

01929

(s4c1)

02799

02754

02786

01781

01565

01962

00813

01870

01445

01556

01554

01026

(s4c2)

02597

02547

02580

01278

00974

01551

-00235

01392

00699

00952

00889

00125

(s4c3)

02394

02339

02375

00776

00384

0114

0-012

8100915

-0004

700349

00226

-00774

(s4c4)

02192

02132

02169

00275

-00205

00729

-02326

00439

-00792

-00254

-00437

-016

73(s4c5)

01989

01926

01964

-00225

-00794

00319

-033

69-00037

-015

35-00856

-010

99-02570

Mathematical Problems in Engineering 21

the transaction cost structures (s0 c1) (s0 c2) (s0 c3) (s0c4) (s0 c5) if we do not consider transparent transactioncost ie c=0 the average ARR of RNN is 02531 under thetransaction cost structure (s1 c0) (s2 c0) (s3 c0) (s4c0) so transparent transaction cost has greater impact thanslippage Through multiple comparative analysis the ARRunder the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s0 c1) are not significantly different from the ARRwithout transaction cost for MLP DBN and SAE the ARRunder all other transaction cost structures are significantlysmaller than theARRwithout transaction cost For all tradingalgorithms except for MLP DBN and SAE the ARR underthe transaction cost structures (s1 c0) (s2 c0) are notsignificantly different from the ARR without transactioncost the ARR under all other transaction cost structures aresignificantly smaller than the ARR without transaction cost

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 26 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theASR of each algorithm is the lowest Compared with settingwithout transaction cost the ASR of MLP DBN and SAEreduce by 3997 4123 and 4066 respectively while theASR of other trading algorithms reduce by more than 90compared with the case of no transaction cost Thereforeexcessive transaction cost will significantly reduce ASR Fora general setting of s and c ie (s c) = (002 0003) theASR of MLP DBN and SAE decrease by 2262 2336and 2302 respectively while the ASR of other algorithmsdecrease by more than 50 the ASR of CART and XGBdecrease by more than 100Therefore MLP DBN and SAEare more tolerant to transaction cost From single tradingalgorithm such as NB if we do not consider slippage ies=0 the average ASR of NB is 08052 under the transactioncost structure (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5)if we do not consider transparent transaction cost ie c=0the average ASR of NB is 14182 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has greater impact than slippage Throughmultiple comparative analysis the ASR under the transactioncost structures (s1 c0) (s2 c0) (s3 c0) (s0 c1) are notsignificantly different from the ASR without transaction costfor MLP DBN and SAE the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the ASR under the transaction cost structures(s1 c0) (s2 c0) are not significantly different from the ASRwithout transaction cost the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 27 MDD increases with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the settings without transaction cost theMDD of MLP DBN and SAE increase by 932 1108 and

1032 respectively The MDD of other trading algorithmsincrease by more than 80 compared with those withoutconsidering transaction costTherefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 483 580 and 533respectively while the MDD of other algorithms increase bymore than 35 and theMDDofCART RF andXGB increasebymore than 100Therefore MLP DBN and SAE are moretolerant to transaction cost As awhole theDNNmodels havestronger capacity to accommodate transaction cost than thetraditional ML models From single trading algorithm suchas GRU if we do not consider slippage ie s=0 the averageMDD of GRU is 04459 under the transaction cost structures(s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do notconsider transparent transaction cost ie c=0 the averageMDD of GRU is 03559 under the transaction cost structures(s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparent transactioncost has greater impact than slippage Through multiplecomparative analysis the MDD under any the transactioncost structure is not significantly different from the MDDwithout transaction cost for MLP DBN and SAE For alltrading algorithms except for MLP DBN and SAE such asLR the MDD under the transaction cost structures (s0 c1)(s1 c0) (s2 c0) (s3 c0) are not significantly different fromthe MDD without transaction cost the MDD under all othertransaction cost structures are significantly greater than theMDD without transaction cost

Through the analysis of the Table 27 performance eval-uation indicators we find that trading performance afterconsidering transaction cost will be worse than that withoutconsidering transaction cost as is in actual trading situationIt is noteworthy that the performance changes of DNNalgorithms especially MLP DBN and SAE are very smallafter considering transaction cost This shows that the threealgorithms have good tolerance to changes of transactioncost Especially for the MDD of the three algorithms thereis no significant difference with that with no transactioncost So we can consider applying them in actual tradingMeanwhile we conclude that the transparent transactioncost has greater impact on the trading performances thanthe slippage for SPICS This is because the prices of SPICSare too high when the transparent transaction cost is setto a certain percentage of turnover In actual transactionsspecial attention needs to be paid to the fact that the trans-action performance under most transaction cost structuresis significantly lower than the trading performance withoutconsidering transaction cost It is worth noting that theperformance of traditional ML algorithm is not worse thanthat ofDNNalgorithmswithout considering transaction costwhile the performance of DNN algorithms is better than thatof traditional ML algorithms after considering transactioncost

63 Analysis of Impact of Transaction Cost on the TradingPerformance of CSICS Similar to Section 62 we will discussthe impact of transaction cost on trading performance ofCSICS in the followings In the Chinese A-share marketthe transparent transaction cost is usually set to a certain

22 Mathematical Problems in Engineering

Table26Th

eASR

ofSP

ICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

1546

815

412

15502

15764

15571

15828

13927

16237

16763

15818

16018

16298

(s0c1)

1456

214

478

14577

1300

012

317

13565

09346

13554

12650

12472

12456

11294

(s0c2)

13639

13527

13635

10191

09015

11262

04657

10822

08482

09074

08846

06236

(s0c3)

12702

12561

12679

07355

05690

08929

-00085

08061

04298

05652

05216

0118

2(s0c4)

11751

11581

11709

04511

02366

06580

-04823

05291

00139

02234

01596

-03812

(s0c5)

1079

10591

10728

01678

-00931

04227

-09500

02534

-039

59-01152

-019

87-08696

(s1c0)

15121

1505

715

149

1492

714

606

15119

1244

915

424

1558

214

825

14974

1488

6(s1c1)

14208

14116

14217

12146

11334

12841

07823

12722

1144

711459

11394

09859

(s1c2)

13279

13159

13270

09325

08020

10526

03105

09977

07267

08048

07772

04792

(s1c3)

12337

12188

12308

064

8204690

08185

-016

4607209

03082

04622

04139

-00257

(s1c4)

11382

11204

11333

03637

01368

05831

-06374

04438

-010

6801208

00524

-052

31(s1c5)

10417

10210

10348

00807

-019

2003478

-110

2501686

-05146

-02169

-0304

7-10083

(s2c0)

1477

1469

914

792

1408

113

632

1440

310

946

1460

114

390

1382

213

922

1346

2(s2c1)

13851

13752

13854

11285

10343

12111

06283

11883

10237

10439

10325

08416

(s2c2)

12916

12789

12901

08454

07021

09785

01547

09128

060

4907019

06696

03346

(s2c3)

11969

11812

11934

05607

03688

07437

-032

0506355

01868

03591

03063

-016

90(s2c4)

11010

10825

10955

02763

00372

05081

-07916

03586

-02268

00183

-00545

-06639

(s2c5)

1004

109827

09967

-0006

-02905

02729

-12533

00841

-06323

-031

79-04101

-114

54(s3c0)

14415

14337

14432

13227

12650

13679

09425

13770

13189

12810

12862

12030

(s3c1)

13490

13384

13488

10419

09348

11375

04733

11039

09023

09413

09252

06971

(s3c2)

12551

12416

12529

07580

060

19090

40-00013

08275

04832

05988

05618

01904

(s3c3)

11599

11435

11558

04731

02688

066

88-04757

05500

00658

02562

01988

-031

16(s3c4)

10636

10443

10575

01891

-00620

04331

-0944

202735

-0346

0-00836

-016

08-08034

(s3c5)

09664

09443

09584

-00924

-03883

01982

-14018

000

00-074

89-04183

-05146

-12808

(s4c0)

14058

13972

1406

812

368

11662

12950

07892

12933

11983

11793

11796

10591

(s4c1)

13127

13013

13119

09549

08350

10634

03180

10190

07807

08386

08177

05527

(s4c2)

12183

1204

12155

06705

05018

08293

-015

6807421

03617

04958

04542

004

68(s4c3)

11226

11055

11179

03857

01691

05938

-06295

046

47-00545

01537

00918

-04529

(s4c4)

1026

1006

10193

01021

-016

0703582

-10948

01888

-0464

2-018

49-02665

-09413

(s4c5)

09286

09057

09199

-017

83-04853

01238

-15478

-00836

-0864

2-05177

-06182

-14142

Mathematical Problems in Engineering 23

Table 27 The MDD of SPICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 03583 03584 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338(s0 c1) 03629 03638 03594 03779 03986 03636 04072 03712 03843 03963 03972 04203(s0 c2) 03677 03695 03647 04302 04707 03968 05168 04127 04842 04729 04787 05735(s0 c3) 03727 03756 03703 04990 05639 04376 06564 04709 06172 05682 05844 07335(s0 c4) 03781 03821 03764 05767 06612 04873 07804 05424 07377 06653 06913 08447(s0 c5) 03839 03890 03828 06529 0746 05444 08730 06162 08272 07501 07808 09118(s1 c0) 03596 03600 03560 03500 036130 03446 03574 03502 03414 03585 03569 03540(s1 c1) 03642 03655 03609 03907 04156 03717 04320 03814 04067 04154 04170 04541(s1 c2) 03691 03712 03662 04466 04936 04066 05534 04270 05172 04971 05049 06168(s1 c3) 03742 03774 03720 05183 05895 04495 06928 04885 06499 05937 06129 07662(s1 c4) 03796 03839 03781 05961 06842 05013 08105 05610 07631 06884 07161 08649(s1 c5) 03856 03909 03847 0671 07646 05595 08946 06342 08451 07691 0800 09235(s2 c0) 03609 03615 03573 03607 03756 03517 03770 03586 03586 03739 03727 03787(s2 c1) 03656 03671 03623 04047 04349 03805 04627 03929 04339 04365 04397 04929(s2 c2) 03705 03729 03678 04642 05176 04171 05916 04424 05504 05218 05327 06577(s2 c3) 03756 03792 03736 05377 06143 04624 07277 05067 06805 06183 06402 07939(s2 c4) 03812 03859 03799 06155 07056 05161 08380 05796 07856 07099 07388 08816(s2 c5) 03873 03930 03866 06887 07816 05751 09126 06517 08606 07864 08172 09331(s3 c0) 03622 03631 03588 03729 03912 03594 04004 03685 03795 03909 03909 04081(s3 c1) 03669 03687 03639 04200 04555 03901 04966 04062 04622 04587 04642 05334(s3 c2) 03719 03746 03694 04826 05423 04286 06295 04589 05833 05465 05607 06936(s3 c3) 03772 03811 03754 05572 06377 04762 07609 05248 07081 06420 06657 08175(s3 c4) 03829 03879 03818 06341 07254 05314 08620 05980 08054 07300 07593 08956(s3 c5) 03894 03954 03888 07056 07972 05909 09275 06689 08740 08022 08325 09412(s4 c0) 03635 03647 03602 03861 04082 03678 04274 03798 04015 04096 04114 04396(s4 c1) 03683 03704 03654 04362 04774 04005 05325 04211 04908 04814 04894 05730(s4 c2) 03734 03765 03712 05013 05664 04410 06667 04758 06142 05707 05875 07253(s4 c3) 03790 03833 03775 05765 06600 04905 07906 05429 07330 06644 06894 08375(s4 c4) 03851 03904 03841 06521 07439 05470 08824 06162 08230 07485 07782 09074(s4 c5) 03917 03981 03913 07218 08115 06067 09395 06857 08858 08165 08463 09480

percentage of turnover and it is the same as the assumptionin the experimental settings As in the US stock market thesmallest unit of price change is 001 (one tick) It is reasonableto set slippage to be 001-005 Of course it should be notedthat the prices fluctuation may be more intense when closingthan that in the middle of a trading day

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 28 the WR is decreasing with the increaseof transaction cost for any trading algorithm When thetransaction cost is set to (s c) = (004 0005) the WR of eachalgorithm is the smallest Comparedwith the settings withouttransaction cost the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR SVM and XGB are reduced by671 688 697 2269 1726 1548 2430 14912484 2112 2112 and 2919 respectively For a generalsetting of s and c ie (s c) = (002 0003) the WR ofMLP DBN and SAE decrease by 410 420 and 430respectively while the WR of other algorithms decrease bymore than 9 the WR of CART RF and XGB decrease by

more than 15 Therefore MLP DBN and SAE are moretolerant to transaction cost From single trading algorithmsuch as LSTM if we do not consider slippage ie s=0 theaverage WR of DBN is 05417 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage WR of LSTM is 05304 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the WR under the transactioncost structures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the WR without transaction cost for MLPDBN SAE and NB the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN SAE and NB the WR under the transaction coststructure (s0 c1) is not significantly different from the WRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

24 Mathematical Problems in Engineering

Table 28 The WR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803(s0 c1) 05523 05527 05525 05525 05608 05620 05009 05227 05612 05665 05571 05595(s0 c2) 05488 05492 05489 05389 05512 05535 04879 05149 05460 05542 05445 05411(s0 c3) 05453 05456 05452 05258 05414 05451 04747 05068 05313 05418 05320 05234(s0 c4) 05417 05419 05414 05127 05320 05368 04622 04991 05172 05297 05202 05067(s0 c5) 05383 05383 05379 05004 05230 05286 04504 04917 05036 05180 05088 04905(s1 c0) 05494 05499 05497 05444 05541 05558 04925 05170 05520 05584 05492 05488(s1 c1) 05456 05459 05456 05286 05424 05456 04775 05080 05342 05437 05345 05275(s1 c2) 05421 05423 05420 05161 05335 05377 04654 05007 05207 05320 05231 05110(s1 c3) 05386 05388 05383 05036 05246 05296 04530 04931 05065 05205 05116 04946(s1 c4) 05353 05354 05349 04915 05156 05218 04419 04861 04937 05095 05007 04795(s1 c5) 05323 05323 05317 04808 05076 05148 04315 04796 04817 04995 04905 04652(s2 c0) 05431 05434 05431 05219 05368 05403 04707 05036 05269 05374 05286 05189(s2 c1) 05395 05397 05393 05078 05266 05314 04573 04956 05115 05242 05154 05005(s2 c2) 05360 05361 05357 04960 05181 05237 04458 04886 04985 05134 05046 04853(s2 c3) 05331 05331 05326 04850 05100 05167 04352 04818 04864 05031 04945 04711(s2 c4) 05300 05300 05293 04743 05018 05093 04252 04752 04746 04931 04846 04572(s2 c5) 05273 05271 05266 04648 04946 05029 04159 04692 04639 04838 04755 04445(s3 c0) 05373 05374 05371 05019 05216 05265 04514 04917 05049 05186 05098 04932(s3 c1) 05341 05341 05336 04902 05128 05188 04399 04846 04917 05074 04990 04775(s3 c2) 05312 05312 05306 04798 05052 05122 04303 04782 04804 04977 04896 04644(s3 c3) 05281 05281 05275 04696 04976 05049 04206 04718 04689 04879 04799 04509(s3 c4) 05252 05251 05245 04598 04901 04984 04110 04657 04581 04785 04707 04378(s3 c5) 05226 05223 05218 04510 04833 04924 04023 04602 04481 04701 04621 04264(s4 c0) 05325 05325 05321 04860 05089 05150 04360 04816 04870 05030 04949 04723(s4 c1) 05294 05294 05289 04753 05010 05079 04258 04750 04752 04928 04849 04588(s4 c2) 05266 05265 05259 04653 04937 05013 04164 04690 04642 04838 04761 04458(s4 c3) 05238 05236 05230 04562 04864 04948 04073 04632 04541 04747 04672 04336(s4 c4) 05211 05208 05203 04475 04798 04891 03985 04577 04440 04662 04586 04218(s4 c5) 05186 05182 05176 04392 04733 04832 03901 04524 04348 04582 04509 04109

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 29 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the smallest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 5073 5175 and 5225 respectivelyWhile the ARR of other trading algorithms decrease bymore than 100 compared with those algorithms withouttransaction cost Therefore excessive transaction cost canlead to serious losses in the accounts For a general settingof s and c ie (s c) = (002 0003) ARR of MLP DBNand SAE decrease by 2741 2797 and 2825 respectivelywhile the ARR other algorithms decrease by more than 50and that of CART NB RF and XGB decrease by more than100 Therefore MLP DBN and SAE are more tolerant totransaction cost From single trading algorithm such as SAEif we do not consider slippage ie s=0 the average ARR ofSAE is 05040 under the transaction cost structure (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not consider

transparent transaction cost ie c=0 the averageARRof SAEis 04468 under the transaction cost structures (s1 c0) (s2c0) (s3 c0) (s4 c0) so transparent transaction cost hassmaller impact than slippage Through multiple comparativeanalysis the ARR under the transaction cost structures (s0c1) (s0 c2) (s0 c3) (s0 c1) (s1 c1) are not significantlydifferent from the ARR without transaction cost for MLPDBN and SAE the ARR under all other transaction coststructures are significantly smaller than the ARR withouttransaction cost For RNN LSTM GRU CART RF LR andSVM the ARR under the transaction cost structures (s0c1) (s0 c2) (s1 c0) are not significantly different fromthe ARR without transaction cost the ARR under all othertransaction cost structures are significantly smaller than theARR without transaction cost For NB and XGB the ARRunder the transaction cost structures (s0 c1) (s1 c0) arenot significantly different from the ARR without transactioncost the ARR under all other transaction cost structuresare significantly smaller than the ARR without transactioncost

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 4: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

4 Mathematical Problems in Engineering

Table 1 Main parameter settings of traditional ML algorithms

Input Features Label Main parametersLR Matrix(25044) Matrix(2501) A specification for the model link function is logitSVM Matrix(25044) Matrix(2501) The kernel function used is Radial Basis kernel Cost of constraints violation is 1CART Matrix(25044) Matrix(2501) The maximum depth of any node of the final tree is 20 The splitting index can be Gini coefficientRF Matrix(25044) Matrix(2501) The Number of trees is 500 Number of variables randomly sampled as candidates at each split is 7BN Matrix(25044) Matrix(2501) the prior probabilities of class membership is the class proportions for the training setXGB Matrix(25044) Matrix(2501) The maximum depth of a tree is 10 the max number of iterations is 15 the learning rate is 03

Table 2 Main parameter settings of DNN algorithms

Input Features Label Learning rate Dimensions of hidden layers Activation function Batch size EpochMLP Matrix(25044) Matrix(2501) 08 c(2515105) sigmoid 100 3DBN Matrix(25044) Matrix(2501) 08 c(2515105) sigmoid 100 3SAE Matrix(25044) Matrix(2501) 08 c(20105) sigmoid 100 3RNN Array(125044) Array(12501) 001 c(105) sigmoid 1 1LSTM Array(125044) Array(12501) 001 c(105) sigmoid 1 1GRU Array(125044) Array(12501) 001 c(105) sigmoid 1 1

and then apply the trainedmodel to implement the predictionfor the out-of-sample data (testing dataset) of the future timeperiod After that a new training set which is the previoustraining set walk one step forward is carried out the trainingof the next round WFA can improve the robustness and theconfidence of the trading strategy in real-time trading

In this paper we useML algorithms and theWFAmethodto do stock price trend predictions as trading signals In eachstep we use the data from the past 250 days (one year) as thetraining set and the data for the next 5 days (one week) asthe test set Each stock contains data of 2000 trading daysso it takes (2000-250)5 = 350 training sessions to produce atotal of 1750 predictions which are the trading signals of dailytrading strategy TheWFAmethod is as shown in Figure 2

33 The Algorithm Design of Trading Signal In this part weuseML algorithms as classifiers to predict the ups and downsof the stock in SPICS and CSICS and then use the predictionresults as trading signals of daily trading We use the WFAmethod to train each ML algorithm We give the generatingalgorithm of trading signals according to Figure 2 which isshown in Algorithm 1

4 Evaluation Indicators andBacktesting Algorithm

41 Directional Evaluation Indicators In this paper we useML algorithms to predict the direction of stock price sothe main task of the ML algorithms is to classify returnsTherefore it is necessary for us to use directional evaluationindicators to evaluate the classification ability of these algo-rithms

The actual label values of the dataset are sequences ofsets DOWN UP Therefore there are four categories ofpredicted label values and actual label values which areexpressed as TU FU FD and TD TU denotes the number ofUP that the actual label values are UP and the predicted label

Table 3 Confusion matrix of two classification results of MLalgorithm

Predicted label valuesUP DOWN

Actual label values UP TU FDDOWN FU TD

values are also UP FU denotes the number of UP that theactual label values are DOWN but the predicted label valuesare UP TD denotes the number of DOWN that the actuallabel values are DOWN and the predicted label values areDOWN FD denotes the number of DOWN that the actuallabel values are UP but the predicted label values are DOWNas shown in Table 3 Table 3 is a two-dimensional table calledconfusionmatrix It classifies predicted label values accordingto whether predicted label values match real label values Thefirst dimension of the table represents all possible predictedlabel values and the second dimension represents all real labelvalues When predicted label values equal real label valuesthey are correct classifications The correct prediction labelvalues lie on the diagonal line of the confusion matrix Inthis paper what we are concerned about is that when thedirection of stock price is predicted to be UP tomorrow webuy the stock at todayrsquos closing price and sell it at tomorrowrsquosclosing price when we predict the direction of stock price tobe DOWN tomorrow we do nothing So UP is a ldquopositiverdquolabel of our concern

In most of classification tasks AR is generally usedto evaluate performance of classifiers AR is the ratio ofthe number of correct predictions to the total number ofpredictions That is as follows

119860119877 =(119879119880 + 119879119863)

(119879119880 + 119865119863 + 119865119880 + 119879119863)(1)

Mathematical Problems in Engineering 5

ML Algorithm

44-dim

2000

-dim

44-dim

44-dim

44-dim

44-dim

44-dim

44-dim

250-

dim

5-di

m25

0-di

m5-

dim

250-

dim

5-di

m

1-dim

1-dim

1-dim

1-dim

5-di

m5-

dim

5-di

m

1750

-dim

ConcatenateML Algorithm

ML Algorithm

Raw

Inpu

t Dat

a

Figure 2The schematic diagram of WFA (training and testing)

Input Stock SymbolsOutput Trading Signals(1) N=Length of Stock Symbols(2) L=Length of Trading Days(3) P=Length of Features(4) k= Length of Training Dataset for WFA(5) n= Length of Sliding Window for WFA(6) for (i in 1 N) (7) Stock=Stock Symbols[i](8) M=(L-k)n(9) Trading Signal=NULL(10) for (j in 1M) (11) Dataset= Stock[(k+nlowast(j-1))(k+n+nlowast(j-1)) 1(P+1)](12) Train=Dataset[1k1(1+P)](13) Test= Dataset[(k+1)(k+n)1P](14) Model=ML Algorithm(Train)(15) Probability=Model(Test)(16) if (Probabilitygt=05) (17) Trading Signal0=1(18) else (19) Trading Signal0=0(20) (21) (22) Trading Signal=c (Trading Signal Trading Signal0)(23) (24) return (Trading Signal)

Algorithm 1 Generating trading signal in R language

6 Mathematical Problems in Engineering

In this paper ldquoUPrdquo is the profit source of our tradingstrategiesThe classification ability ofML algorithm is to eval-uate whether the algorithms can recognize ldquoUPrdquo Thereforeit is necessary to use PR and RR to evaluate classificationresults These two evaluation indicators are initially appliedin the field of information retrieval to evaluate the relevanceof retrieval results

PR is a ratio of the number of correctly predicted UP toall predicted UP That is as follows

119875119877 =119879119880

(119879119880 + 119865119880)(2)

High PR means that ML algorithms can focus on ldquoUPrdquorather than ldquoDOWNrdquo

RR is the ratio of the number of correctly predicted ldquoUPrdquoto the number of actually labeled ldquoUPrdquo That is as follows

119875119877 =119879119880

(119879119880 + 119865119863)(3)

High RR can capture a large number of ldquoUPrdquo and beeffectively identified In fact it is very difficult to present analgorithm with high PR and RR at the same time Thereforeit is necessary to measure the classification ability of theML algorithm by using some evaluation indicators whichcombine PR with RR F1-Score is the harmonic average ofPR and AR F1 is a more comprehensive evaluation indicatorThat is as follows

1198651= 2 lowast 119875119877 lowast

119860119877

(119875119877 + 119860119877)(4)

Here it is assumed that theweights of PR andRR are equalwhen calculating F1 but this assumption is not always correctIt is feasible to calculate F1 with different weights for PR andRR but determining weights is a very difficult challenge

AUC is the area under ROC (Receiver Operating Charac-teristic) curve ROC curve is often used to check the tradeoffbetween finding TU and avoiding FU Its horizontal axisis FU rate and its vertical axis is TU rate Each point onthe curve represents the proportion of TU under differentFU thresholds [36] AUC reflects the classification ability ofclassifier The larger the value the better the classificationability It is worth noting that two different ROC curves maylead to the same AUC value so qualitative analysis should becarried out in combination with the ROC curve when usingAUCvalue In this paper we use R language package ldquoROCRrdquoto calculate AUC

42 Performance Evaluation Indicator Performance evalua-tion indicator is used for evaluating the profitability and riskcontrol ability of trading algorithms In this paper we usetrading signals generated by ML algorithms to conduct thebacktesting and apply the WR ARR ASR and MDD to dothe trading performance evaluation [34] WR is a measureof the accuracy of trading signals ARR is a theoretical rateof return of a trading strategy ASR is a risk-adjusted returnwhich represents return from taking a unit risk [37] and therisk-free return or benchmark is set to 0 in this paper MDDis the largest decline in the price or value of the investmentperiod which is an important risk assessment indicator

43 Backtesting Algorithm Using historical data to imple-ment trading strategy is called backtesting In research andthe development phase of trading model the researchersusually use a new set of historical data to do backtesting Fur-thermore the backtesting period should be long enoughbecause a large number of historical data can ensure that thetrading model can minimize the sampling bias of data Wecan get statistical performance of tradingmodels theoreticallyby backtesting In this paper we get 1750 trading signals foreach stock If tomorrowrsquos trading signal is 1 we will buy thestock at todayrsquos closing price and then sell it at tomorrowrsquosclosing price otherwise we will not do stock trading Finallywe get AR PR RR F1 AUC WR ARR ASR and MDD byimplementing backtesting algorithm based on these tradingsignals

5 Comparative Analysis ofDifferent Trading Algorithms

51 Nonparametric Statistical Test Method In this part weuse the backtesting algorithm(Algorithm 2) to calculate theevaluation indicators of different trading algorithms In orderto test whether there are significant differences betweenthe evaluation indicators of different ML algorithms thebenchmark indexes and the BAH strategies it is necessaryto use analysis of variance and multiple comparisons to givethe answers Therefore we propose the following nine basichypotheses for significance test in which Hja (119895 = 1 2 3 45 6 7 8 9) are the null hypothesis and the correspondingalternative assumptions areHjb (119895 = 1 2 3 4 5 6 7 8 9)Thelevel of significance is 005

For any evaluation indicator 119895 isin 119860119877 119875119877 119877119877 1198651 119860119880119862119882119877119860119877119877 119860119878119877119872119863119863 and any trading strategy 119894 isin 119872119871119875119863119861119873 119878119860119864 119877119873119873 119871119878119879119872 119866119877119880 119871119877 119878119881119872 119873119861119862119860119877119879 119877119865119883119866119861119861119860119867 119861119890119899119888ℎ119898119886119903119896 119894119899119889119890119909 the null hypothesis a is Hjaalternative hypotheses b is Hjb (119895 = 1 2 3 4 5 6 7 8 9represent AR PR RR F1 AUC WR ARR ASR MDDrespectively)

Hja the evaluation indicator j of all strategies are thesameHjb the evaluation indicator j of all strategies are notthe same

It is worth noting that any evaluation indicator of alltrading algorithm or strategy does not conform to the basichypothesis of variance analysisThat is it violates the assump-tion that the variances of any two groups of samples are thesame and each group of samples obeys normal distributionTherefore it is not appropriate to use t-test in the analysisof variance and we should take the nonparametric statisticaltest method instead In this paper we use the Kruskal-Wallisrank sum test [38] to carry out the analysis of variance If thealternative hypothesis is established we will need to furtherapply the Nemenyi test [39] to do the multiple comparisonsbetween trading strategies

52 Comparative Analysis of Performance of Different TradingStrategies in SPICS Table 4 shows the average value of

Mathematical Problems in Engineering 7

Input TS TS is trading signals of a stockOutput AR PR RR F1 AUC WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) Bt=Benchmark Index [ldquoClosing Pricerdquo] B is the closing price of benchmark index(3) WR=NULL ARR=NULL ASR=NULL MDD=NULL(4) for (i in 1 N) (5) Stock Data=Stock Code List[i](6) Pt=Stock Data [ldquoClosing Pricerdquo](7) Labelt= Stock Data [ldquoLabelrdquo](8) BDRRt=(Bt-Bt-1) Bt-1 BDRR is the daily return rate of benchmark index(9) DRRt= (Pt-Pt-1)Pt-1 DRR is daily return rateThat is daily return rate of BAH strategy(10) TDRRt=lag (TSt)lowastDRRt TDRR is the daily return through trading(11) Table=Confusion Matrix(TS Label)(12) AR[i]=sum(adj(Table))sum(Table)(13) PR[i]=Table[2 2]sum(Table[ 2])(14) RR[i]=Table[2 2]sum(Table[2 ])(15) F1=2lowastPR[i]lowastRR[i](PR[i]+RR[i])(16) Pred=prediction (TS Label)(17) AUC[i]=performance (Pred measure=ldquoaucrdquo)yvalues[[1]](18) WR[i]=sum (TDRRgt0)sum(TDRR =0)(19) ARR[i]=Returnannualized (TDRR) TDRR BDRR or DRR can be used(20) ASR[i]=SharpeRatioannualized (TDRR) TDRR BDRR or DRR can be used(21) MDD[i]=maxDrawDown (TDRR) TDRR BDRR or DRR can be used(22) AR=c (AR AR[i])(23) PR=c (PR PR[i])(24) RR=c (RR RR[i])(25) F1=c (F1 F1[i])(26) AUC=c (AUC AUC[i])(27) WR=c (WR WR[i])(28) ARR=c (ARR ARR[i])(29) ASR=c (ASR ASR[i])(30) MDD=c (MDD MDD[i])(31) (32) Performance=cbind (AR PR RR F1 AUC WR ARR ASR MDD)(33) return (Performance)

Algorithm 2 Backtesting algorithm of daily trading strategy in R language

Table 4 Trading performance of different trading strategies in the SPICS Best performance of all trading strategies is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGBAR mdash mdash 05205 05189 05201 05025 05013 04986 06309 05476 06431 06491 06235 06600PR mdash mdash 07861 07764 07781 05427 05121 04911 06514 05270 06595 06474 06733 06738RR mdash mdash 05274 05263 05273 05245 05253 05239 06472 05762 06599 06722 06325 06767F1 mdash mdash 06258 06217 06229 05332 05183 05065 06491 05480 06595 06591 06517 06751AUC mdash mdash 05003 05001 05002 04997 05005 04992 06295 05489 06418 06491 06199 06590WR 05450 05235 05676 05680 05683 05843 05825 05844 05266 05930 05912 05859 05831 05891ARR 01227 01603 03333 03298 03327 02945 02921 02935 03319 02976 03134 02944 03068 03042ASR 08375 06553 15472 15415 15506 15768 15575 15832 13931 16241 16768 15822 16022 16302MDD 01939 04233 03584 03585 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338

various trading algorithms in AR PR RR F1 AUC WRARR ASR and MDD We can see that the AR RR F1 andAUC of XGB are the greatest in all trading algorithms TheWR of NB is the greatest in all trading strategies The ARRof MLP is the greatest in all trading strategies including thebenchmark index (SampP 500 index) and BAH strategy TheASR of RF is the greatest in all trading strategies TheMDDofthe benchmark index is the smallest in all trading strategies

It is worth noting that the ARR and ASR of all ML algorithmsare greater than those of BAH strategy and the benchmarkindex

(1) Through the hypothesis test analysis of H1a and H1bwe can obtain p valuelt22e-16

Therefore there are statistically significant differencesbetween the AR of all trading algorithms Therefore we needto make multiple comparative analysis further as shown in

8 Mathematical Problems in Engineering

Table 5Multiple comparison analysis between theAR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 10000GRU 00000 00000 00000 08273 09811CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00232 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 07649SVM 00000 00000 00000 00000 00000 00000 06057 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00002 02010 00000

Table 6Multiple comparison analysis between the PR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 09999SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00034GRU 00000 00000 00000 00000 01472CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 07869 05786 00000 00000RF 00000 00000 00000 00000 00000 00000 08056 00000LR 00000 00000 00000 00000 00000 00000 09997 00000 02626SVM 00000 00000 00000 00000 00000 00000 00008 00000 03104 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00491 00000 09999

Table 5 The number in the table is a p value of any two algo-rithms of Nemenyi test When p valuelt005 we think thatthe two trading algorithms have a significant differenceotherwise we cannot deny the null assumption that the meanvalues of AR of the two algorithms are equal From Tables 5and 4 we can see that the AR of all DNN models are signif-icantly lower than those of all traditional MLmodelsTheARof MLP DBN and SAE are significantly greater than those ofRNN LSTM and GRU There are no significant differencesamong the AR of MLP DBN and SAE There are no sig-nificant differences among the AR of RNN LSTM and GRU

(2) Through the hypothesis test analysis of H2a and H2bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between the PR of all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 6 The number in the table is a pvalue of any two algorithms of Nemenyi test From Tables 6and 4 we can see that the PR of MLP DBN and SAE aresignificantly greater than that of other trading algorithmsThe PR of LSTM is not significantly different from that ofGRU and NBThe PR of GRU is significantly lower than thatof all traditional ML algorithms The PR of NB is significantlylower than that of other traditional ML algorithms

(3) Through the hypothesis test analysis of H3a and H3bwe can obtain p valuelt22e-16 So there are statistically

significant differences between the RR of all trading algo-rithms Therefore we need to make multiple comparativeanalysis further as shown in Table 7 The number in thetable is a p value of any two algorithms of Nemenyi testFrom Tables 7 and 4 we can see that there is no significantdifference among the RR of all DNN models but the RRof any DNN model is significantly lower than that of alltraditional ML models The RR of NB is significantly lowerthan that of other traditional ML algorithms The RR ofCART is significantly lower than that of other traditional MLalgorithms except for NB

(4) Through the hypothesis test analysis of H4a and H4bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between the F1 of all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 8 The number in the table is a pvalue of any two algorithms of Nemenyi test From Tables8 and 4 we can see that there is no significant differenceamong the F1 of MLP DBN and SAE The F1 of MLP DBNand SAE are significantly greater than that of RNN LSTMGRU andNB but are significantly smaller than that of RF LRSVM and XGBThe F1 of GRU and LSTMhave no significantdifference but they are significantly smaller than that of alltraditional ML algorithms The F1 of XGB is significantlygreater than that of all other trading algorithms

Mathematical Problems in Engineering 9

Table 7Multiple comparison analysis between the RR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 10000 10000 10000LSTM 10000 10000 10000 10000GRU 09999 10000 09999 10000 10000CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00485 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 00555SVM 00000 00000 00000 00000 00000 00000 00197 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00010 09958 00000

Table 8Multiple comparison analysis between the F1 of any two trading algorithms The p value of the two trading strategies with significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 09998SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00810GRU 00000 00000 00000 00000 03489CART 00861 00061 00117 00000 00000 00000NB 00000 00000 00000 04635 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00078 00000LR 00000 00000 00000 00000 00000 00000 00173 00000 10000SVM 00007 00000 00000 00000 00000 00000 09797 00000 03336 04825XGB 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000

Table 9 Multiple comparison analysis between the AUC of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 10000 10000 10000LSTM 10000 10000 10000 09999GRU 10000 10000 10000 10000 09975CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00270 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 05428SVM 00000 00000 00000 00000 00000 00000 03125 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00002 03954 00000

(5) Through the hypothesis test analysis of H5a and H5bwe can obtain p valuelt22e-16 So there are statisticallysignificant differences between the AUC of all trading algo-rithms Therefore we need to make multiple comparativeanalysis further as shown in Table 9 The number in thetable is a p value of any two algorithms of Nemenyi testFrom Tables 9 and 4 we can see that there is no significantdifference among the AUC of all DNN models The AUC of

all DNN models are significantly smaller than that of anytraditional ML model

(6) Through the hypothesis test analysis of H6a and H6bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between theWRof all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 10 The number in the table is pvalue of any two algorithms of Nemenyi test From Tables 4

10 Mathematical Problems in Engineering

Table10M

ultip

lecomparis

onanalysisbetweentheW

Rof

anytwotradingalgorithm

sTh

epvalueo

fthe

twotradingstr

ategiesw

ithsig

nificantd

ifference

isin

boldface

Index

BAH

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

BAH

000

00MLP

000

00000

00DBN

000

00000

0010

000

SAE

000

00000

0010

000

1000

0RN

N000

00000

00000

00000

00000

00LSTM

000

00000

00000

00000

00000

0009974

GRU

000

11000

00000

01000

00000

0010

000

09961

CART

000

0009998

000

00000

00000

00000

00000

00000

00NB

000

00000

00000

00000

00000

00000

31000

00000

38000

00RF

000

00000

00000

00000

00000

0000118

000

0100140

000

0010

000

LR000

00000

00000

00000

00000

0010

000

08508

1000

0000

00004

320117

7SV

M000

00000

00000

00000

00000

0010

000

1000

010

000

000

00000

01000

0609780

XGB

000

00000

00000

00000

00000

0002660

000

8402927

000

0009831

09989

07627

00376

Mathematical Problems in Engineering 11

Table 11Multiple comparison analysis between theARRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00001 00006 00001LSTM 00000 00000 00000 00002 00000 10000GRU 00000 00000 00001 00008 00001 10000 10000CART 00000 00000 10000 10000 10000 00001 00000 00001NB 00000 00000 00021 00094 00022 10000 09998 10000 00018RF 00000 00000 07978 09524 08036 01685 00874 01962 07745 05861LR 00000 00000 00002 00012 00002 10000 10000 10000 00002 10000 02408SVM 00000 00000 02375 04806 02427 07029 05214 07457 02178 09778 09999 08015XGB 00000 00000 00674 01856 00694 09423 08466 09576 00600 09996 09905 09739 10000

Table 12Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 09667MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 08763 07617 08998LSTM 00000 00000 09922 09701 09949 10000GRU 00000 00000 06124 04563 06537 10000 09996CART 00000 00000 00002 00005 00002 00000 00000 00000NB 00000 00000 00467 00233 00557 09529 07037 09971 00000RF 00000 00000 00000 00000 00000 00291 00042 01062 00000 08010LR 00000 00000 07506 06025 07859 10000 10000 10000 00000 09872 00602SVM 00000 00000 01759 01020 02010 09982 09399 10000 00000 10000 04671 09998XGB 00000 00000 00099 00044 00122 07548 03776 09470 00000 10000 09681 08791 09997

and 10 we can see that the WR of MLP DBN and SAE haveno significant difference but they are significantly higherthan that of BAH and benchmark index and significantlylower than that of other trading algorithms TheWR of RNNLSTM and GRU have no significant difference but they aresignificantly higher than that of CART and significantly lowerthan that of NB and RF The WR of LR is not significantlydifferent from that of RF SVM and XGB

(7) Through the analysis of the hypothesis test of H7aand H7b we obtain p valuelt22e-16 Therefore there aresignificant differences between the ARR of all trading strate-gies including the benchmark index and BAH We needto do further multiple comparative analysis as shown inTable 11 From Tables 4 and 11 we can see that the ARR ofthe benchmark index and BAH are significantly lower thanthat of all ML algorithms The ARR of MLP DBN and SAEare significantly greater than that of RNN LSTM GRU NBand LR but not significantly different from that of CARTRF SVM and XGB there is no significant difference betweenthe ARR of MLP DBN and SAE The ARR of RNN LSTM

and GRU are significantly less than that of CART but theyare not significantly different from that of other traditionalML algorithms In all traditional ML algorithms the ARR ofCART is significantly greater than that of NB and LR butotherwise there is no significant difference between ARR ofany other two algorithms

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore there are significantdifferences between ASR of all trading strategies includingthe benchmark index and BAH The results of our multiplecomparative analysis are shown in Table 12 From Tables 4and 12 we can see that the ASR of the benchmark index andBAH are significantly smaller than that of all ML algorithmsThe ASR of MLP and DBN are significantly greater than thatof CART and are significantly smaller than that of NB RFand XGB but there is no significant difference between MLPDBN and other algorithms The ASR of SAE is significantlygreater than that of CART and significantly less than that ofRF and XGB but there is no significant difference betweenSAE and other algorithms The ASR of RNN and LSTM

12 Mathematical Problems in Engineering

Table 13 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00052DBN 00000 00031 10000SAE 00000 00012 10000 10000RNN 00000 00000 01645 02243 03556LSTM 00000 00000 06236 07173 08511 10000GRU 00000 00000 00245 00381 00760 10000 09860CART 00000 00000 01496 02057 03309 10000 10000 10000NB 00000 00000 00786 01136 01999 10000 09994 10000 10000RF 00000 00000 00002 00004 00012 08964 04248 09980 09109 09713LR 00000 00000 05451 06428 07935 10000 10000 09933 10000 09998 05015SVM 00000 00000 02433 03194 04734 10000 10000 09999 10000 10000 08155 10000XGB 00000 00000 00103 00167 00360 09998 09462 10000 09999 10000 09998 09685 09989

Table 14 Trading performance of different trading strategies in CSICS Best performance of all trading strategies is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGBAR mdash mdash 05175 05167 05163 05030 04993 04993 05052 05084 05090 05084 05112 05087PR mdash mdash 07548 07436 07439 05414 04964 04956 05022 05109 05128 04967 05695 05026RR mdash mdash 05252 05250 05248 05234 05224 05223 05279 05307 05311 05318 05295 05315F1 mdash mdash 06150 06108 06108 05320 05086 05082 05143 05192 05214 05132 05483 05164AUC mdash mdash 05027 05024 05020 05006 04995 04996 05049 05078 05082 05086 05074 05085WR 05222 05090 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803ARR 00633 02224 05731 05704 05678 05248 05165 05113 05534 06125 04842 05095 05004 04938ASR 02625 04612 14031 14006 13935 14880 15422 15505 12232 11122 14379 15582 14231 14698MDD 04808 06697 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632

are significantly greater than that of CART and significantlyless than that of RF but there is no significant differencebetweenRNN LSTM and other algorithmsTheASRofGRUis significantly greater than that of CART but there is nosignificant difference between GRU and other traditional MLalgorithms In all traditional ML algorithms the ASR of allalgorithms are significantly greater than that of CART butotherwise there is no significant difference between ASR ofany other two algorithms

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between MDD of trading strategies includingthe benchmark index and the BAH The results of multiplecomparative analysis are shown in Table 13 From Tables4 and 13 we can see that MDD of any ML algorithm issignificantly greater than that of the benchmark index butsignificantly smaller than that of BAH strategy The MDDof MLP and DBN are significantly smaller than those ofGRU RF and XGB but there is no significant differencebetween MLP DBN and other algorithms The MDD ofSAE is significantly smaller than that of XGB but there isno significant difference between SAE and other algorithmsOtherwise there is no significant difference betweenMDDofany other two algorithms

In a word the traditional ML algorithms such as NBRF and XGB have good performance in most directional

evaluation indicators such as AR PR and F1 The DNNalgorithms such as MLP have good performance in PR andARR In traditional ML algorithms the ARR of CART RFSVM and XGB are not significantly different from that ofMLP DBN and SAE the ARR of CART is significantlygreater than that of LSTM GRU and RNN but otherwisethe ARR of all traditional ML algorithms are not significantlyworse than that of LSTM GRU and RNN The ASR of alltraditional ML algorithms except CART are not significantlyworse than that of the six DNNmodels even the ASR of NBRF and XGB are significantly greater than that of some DNNalgorithms The MDD of RF and XGB are significantly lessthat of MLP DBN and SAE the MDD of all traditional MLalgorithms are not significantly different from that of LSTMGRU and RNNThe ARR and ASR of all ML algorithms aresignificantly greater than that of BAH and the benchmarkindex the MDD of any ML algorithm is significantly greaterthan that of the benchmark index but significantly less thanthat of BAH strategy

53 Comparative Analysis of Performance of Different TradingStrategies in CSICS The analysis methods of this part aresimilar to Section 52 From Table 14 we can see that the ARPR and F1 of MLP are the greatest in all trading algorithmsThe RR AUC WR and ASR of LR are the greatest inall trading algorithms respectively The ARR of NB is the

Mathematical Problems in Engineering 13

Table 15Multiple comparison analysis between theARof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 01857GRU 00000 00000 00000 04439 10000CART 00000 00000 00000 09765 00024 00131NB 00000 00001 00002 00022 00000 00000 01810RF 00000 00002 00005 00007 00000 00000 00941 10000LR 00000 00000 00000 00076 00000 00000 03454 10000 10000SVM 00217 00766 01309 00000 00000 00000 00003 08314 09352 06360XGB 00000 00001 00001 00025 00000 00000 01930 10000 10000 10000 08168

Table 16Multiple comparison analysis between the PRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 09906 09781NB 00000 00000 00000 00000 01716 01234 08940RF 00000 00000 00000 00000 00319 00205 05271 10000LR 00000 00000 00000 00000 10000 10000 09951 02099 00422SVM 00000 00000 00000 01157 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00000 09922 09811 10000 08836 05086 09960 00000

highest in all trading strategies The MDD of CSI 300 index(benchmark index) is the smallest in all trading strategiesTheWRARR and ASR of all ML algorithms are greater thanthose of the benchmark index and BAH strategy

(1) Through the hypothesis test analysis of H1a and H1bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the AR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 15The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 15 we can see that the AR ofMLPDBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms except for SVM The ARof GRU is significantly smaller than that of all traditional MLalgorithms There is no significant difference between the ARof any two traditional ML algorithms except for CART andSVM

(2) Through the hypothesis test analysis of H2a and H2bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the PR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 16 The number in the tableis a p value of any two algorithms of Nemenyi test FromTables 14 and 16 we can see that the PR of MLP DBN and

SAE are significantly greater than that of all other tradingalgorithms and the PR of MLP DBN and SAE have nosignificant difference The PR of SVM is significantly greaterthan that of all other traditional ML algorithms which haveno significant difference between any two algorithms exceptfor SVM The PR of RNN is significantly greater than thatof all traditional ML algorithms except for SVM The PR ofGRU and LSTM are not significantly different from that of alltraditional ML algorithms except for SVM and LR

(3) Through the hypothesis test analysis of H3a and H3bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the RR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 17 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 17 we can see that the RR of all DNN models arenot significantly different There is no significant differenceamong the RR of all traditional ML algorithms The RR ofRNN GRU and LSTM are significantly smaller than that ofany traditional ML algorithm except for CART

(4) Through the hypothesis test analysis of H4a and H4bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the F1 of all trading algorithms There-fore we need to do further multiple comparative analysis and

14 Mathematical Problems in Engineering

Table 17Multiple comparison analysis between the RRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 09996 09996 10000LSTM 09309 09314 09781 09999GRU 09660 09663 09916 10000 10000CART 09744 09742 09225 05809 01509 02138NB 01093 01088 00574 00075 00004 00007 08861RF 00537 00534 00260 00028 00001 00002 07544 10000LR 00330 00328 00152 00015 00001 00001 06498 10000 10000SVM 03444 03434 02170 00434 00033 00059 09920 10000 09998 09991XGB 00193 00192 00085 00007 00000 00000 05344 10000 10000 10000 09960

Table 18 Multiple comparison analysis between the F1 of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 07211 06670NB 00000 00000 00000 00136 00132 00099 08664RF 00000 00000 00000 00786 00016 00011 05162 10000LR 00000 00000 00000 00000 09440 09208 10000 05675 02181SVM 00000 00000 00000 00178 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00001 03138 02679 10000 09937 08849 09964 00000

Table 19 Multiple comparison analysis between the AUC of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 09999 10000RNN 09945 09985 10000LSTM 05273 06382 09259 09937GRU 08448 09102 09958 10000 10000CART 06921 05835 02356 00801 00014 00096NB 00002 00001 00000 00000 00000 00000 02616RF 00001 00001 00000 00000 00000 00000 02002 10000LR 00000 00000 00000 00000 00000 00000 00930 10000 10000SVM 00027 00014 00001 00000 00000 00000 06454 10000 09999 09980XGB 00000 00000 00000 00000 00000 00000 01257 10000 10000 10000 09993

the results are shown in Table 18The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 18 we can see that the F1 of MLP DBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms There is no significantdifference among traditionalML algorithms except SVM andthe F1 of SVM is significantly greater than that of all othertraditional ML algorithms

(5) Through the hypothesis test analysis of H5a and H5bwe can obtain p valuelt22e-16Therefore there are significantdifferences between theAUCof all trading algorithmsThere-fore we need to do further multiple comparative analysis andthe results are shown in Table 19 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 19 we can see that the AUC of all DNN models haveno significant difference There is no significant difference

Mathematical Problems in Engineering 15

Table 20 Multiple comparison analysis between the WR of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 04117MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00002 00006 00000LSTM 00000 00000 00000 00000 00000 09772GRU 00000 00000 00000 00000 00000 09911 10000CART 09931 00000 00000 00000 00000 00000 00000 00000NB 00031 00000 00001 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00205 06437 05358 00000 00000LR 00000 00000 00000 00000 00000 00010 01611 01105 00000 00000 10000SVM 00000 00000 00000 00000 00000 09914 10000 10000 00000 00000 05322 01090XGB 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000

Table 21Multiple comparison analysis between theARRof any two trading strategiesThepvalue of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00007MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 04790 06355 07182LSTM 00000 00000 02512 03806 04630 10000GRU 00000 00000 02235 03454 04249 10000 10000CART 00000 00000 08301 09217 09542 10000 09999 09998NB 00000 00000 10000 10000 10000 02920 01295 01125 06517RF 00000 00000 00020 00048 00076 08705 09735 09806 05393 00006LR 00000 00000 02058 03222 03995 10000 10000 10000 09996 01019 09845SVM 00000 00000 10000 00803 01114 09993 10000 10000 09659 00165 09999 10000XGB 00000 00000 10000 00333 00484 09916 09997 09998 08789 00057 10000 09999 10000

between the AUC of all traditional ML algorithms TheAUC of all traditional ML algorithms except for CART aresignificantly greater than that of any DNN model There isno significant difference among the AUC ofMLP SAE DBNRNN and CART

(6)Through the hypothesis test analysis of H6a and H6bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the WR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 20 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 20 we can see that the WR of BAH and benchmarkindex have no significant difference but they are significantlysmaller than that of anyML algorithmTheWRofMLPDBNand SAE are significantly smaller than that of the other trad-ing algorithms but there is no significant difference betweenthe WR of MLP DBN and SAE The WR of LSTM andGRU have no significant difference but they are significantlysmaller than that of XGB and significantly greater than that of

CART and NB In traditional MLmodels the WR of NB andCART are significantly smaller than that of other algorithmsThe WR of XGB is significantly greater than that of all otherML algorithms

(7)Through the analysis of the hypothesis test of H7a andH7b we obtain p valuelt22e-16

Therefore there are significant differences between theARR of all trading strategies including the benchmark indexand BAH strategy Therefore we need to do further multiplecomparative analysis and the results are shown in Table 21FromTables 14 and 21 we can see that ARR of the benchmarkindex and BAH are significantly smaller than that of alltrading algorithms The ARR of MLP is significantly higherthan that of RF but there is no significant difference betweenMLP and other algorithms The ARR of SAE and DBN aresignificantly higher than that of RF and XGB but they arenot significantly different fromARR of other algorithms TheARR of NB is significantly higher than that of RF SVMand XGB But otherwise there is no significant difference

16 Mathematical Problems in Engineering

Table 22Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 08877MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 09099 08862 08114LSTM 00000 00000 03460 03080 02239 09999GRU 00000 00000 02132 01853 01270 09981 10000CART 00000 00000 00158 00195 00327 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000 00000 07298RF 00000 00000 10000 10000 10000 09968 07444 05789 00018 00000LR 00000 00000 01181 01003 00650 09879 10000 10000 00000 00000 04044SVM 00000 00000 10000 10000 10000 09849 05952 04238 00042 00000 10000 02704XGB 00000 00000 09937 09902 09746 10000 09878 09532 00001 00000 10000 08723 09998

Table 23 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00006DBN 00000 00004 10000SAE 00000 00023 10000 10000RNN 00000 00000 00320 00421 00111LSTM 00000 00000 00002 00003 00000 09947GRU 00000 00000 00001 00001 00000 09767 10000CART 00000 00000 01238 01538 00521 10000 09241 08305NB 00000 01875 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 01180 01469 00493 10000 09298 08401 10000 00000LR 00000 00000 00001 00002 00000 09881 10000 10000 08821 00000 08898SVM 00000 00000 03285 03839 01701 09999 07011 05424 10000 00000 10000 06216XGB 00000 00000 00308 00405 00106 10000 09951 09783 10000 00000 10000 09890 09998

between any other two algorithms Therefore the ARR ofmost traditional ML models are not significantly worse thanthat of the best DNNmodel

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore There are significantdifferences betweenASRof all trading strategies including thebenchmark index and BAH strategy The results of multiplecomparative analysis are shown in Table 22 From Tables 14and 22 we can see that the ASR of the benchmark indexand BAH are significantly smaller than that of all tradingalgorithms The ASR of all ML algorithms are significantlyhigher than that of CART and NB but there is no significantdifference between the ASR of CART and NB Beyond thatthere is no significant difference between any other twoalgorithms Therefore the ASR of all traditional ML modelsexcept NB and CART are not significantly worse than that ofany DNNmodel

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between the MDD of these trading strategies

including the benchmark index and the BAH strategyThe results of multiple comparative analysis are shown inTable 23 From Tables 14 and 23 we can see that the MDDof the benchmark index is significantly smaller than that ofother trading strategies including BAH strategy TheMDD ofBAH is significantly greater than that of all trading algorithmsexcept NBTheMDDofMLPDBN and SAE are significantlylower than that of NB but significantly higher than thatof RNN LSTM GRU LR and XGB The MDD of NB issignificantly greater than that of all other trading algorithmsBeyond that there is no significant difference between anyother two algorithms Therefore all ML algorithms expectNB especially LSTM RNN GRU LR and XGB can play arole in controlling trading risk

In a word some DNN models such as MLP DBN andSAE have good performance in AR PR and F1 traditionalML algorithms such as LR and XGB have good performanceinAUCandWRTheARRof some traditionalML algorithmssuch as CART NB LR and SVM are not significantlydifferent from that of the six DNN models The ASR of the

Mathematical Problems in Engineering 17

six DNN algorithms are not significantly different from alltraditional ML models except NB and CART The MDD ofLR and XGB are significantly smaller than those of MLPDBN and SAE and are not significantly different fromthat of LSTM GRU and RNN The ARR and ASR of allML algorithms are significantly greater than those of BAHand benchmark index the MDD of all ML algorithms aresignificantly smaller than that of the benchmark index butsignificantly greater than that of BAH strategy

From the above analysis and evaluation we can see thatthe directional evaluation indicators of some DNN modelsare very competitive in CSICS while the indicators of sometraditional ML algorithms have excellent performance inSPICS Whether in SPICS or CSICS the ARR and ASR ofall ML algorithms are significantly greater than that of thebenchmark index and BAH strategy respectively In all MLalgorithms there are always some traditional ML algorithmswhich are not significantly worse than the best DNN modelfor any performance evaluation indicator (ARR ASR andMDD)Therefore if we do not consider transaction cost andother factors affecting trading performance of DNN modelsare alternative but not the best choice when they are appliedto stock trading

In the same period the ARR of any ML algorithm inCSICS is significantly greater than that of the same algorithmin SPICS (p valuelt0001 in theNemenyi test)Meanwhile theMDD of any ML algorithm in CSICS is significantly greaterthan that of the same algorithm in SPICS (p value lt0001in the Nemenyi test) The results show that the quantitativetrading algorithms can more easily obtain excess returns inthe Chinese A-share market but the volatility risk of tradingin Chinese A-share market is significantly higher than that ofthe US stock market in the past 8 years

6 The Impact of Transaction Cost onPerformance of ML Algorithms

Trading cost can affect the profitability of a stock tradingstrategy Transaction cost that can be ignored in long-termstrategies is significantly magnified in daily trading Howevermany algorithmic trading studies assume that transactioncost does not exist ([10 17] etc) In practice frictions suchas transaction cost can distort the market from the perfectmodel in textbooks The cost known prior to trading activityis referred to as transparent such as commissions exchangefees and taxes The costs that has to be estimated are knownas implicit including comprise bid-ask spread latency orslippage and related market impact This section focuses onthe transparent and implicit cost and how do they affecttrading performance in daily trading

61 Experimental Settings and Backtesting Algorithm In thispart the transparent transaction cost is calculated by a certainpercentage of transaction turnover for convenience theimplicit transaction cost is very complicated in calculationand it is necessary to make a reasonable estimate for therandom changes of market environment and stock pricesTherefore we only discuss the impact of slippage on tradingperformance

The transaction cost structures of American stocks aresimilar to that of Chinese A-shares We assume that transpar-ent transaction cost is calculated by a percentage of turnoversuch as less than 05 [40 41] and 02 and 05 in theliterature [42] It is different for the estimation of slippage

In some quantitative trading simulation software such asJoinQuant [43] and Abuquant [44] the slippage is set to 002The transparent transaction cost and implicit transaction costare charged in both directions when buying and selling Itis worth noting that the transparent transaction cost varieswith the different brokers while the implicit transaction costis related to market liquidity market information networkstatus trading software etc

We set slippages s = s0=0 s1=001 s2=002 s3=003s4=004 the transparent transaction cost c = c0=0 c1=0001c2=0002 c3=0003 c4=0004 c5=0005 For different s ccombinations we study the impact of different transactioncost structures on trading performance We assume thatbuying and selling positions are one unit so the turnover isthe corresponding stock price When buying stocks we notonly need to pay a certain percentage cost of the purchaseprice but also need to pay an uncertain slippage cost Thatis we need to pay a higher price than the real-time price119875119905minus1

when we are buying But when selling stocks we notonly need to pay a certain percentage cost of the sellingprice but also to pay an uncertain slippage cost Generallyspeaking we need to sell at a price lower than the real-timeprice 119875

119905 It is worth noting that our trading strategy is self-

financing If ML algorithms predict the continuous occur-rence of buying signals or selling signals ie |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 0 we will continue to hold or do nothingso the transaction cost at this time is 0 when |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 1 it is indicated that the position maybe changed from holding to selling or from empty positionto buying At this time we would pay transaction costdue to the trading operation Finally we get a real yieldis

119877119890119905119905le119862119897119900119904119890119875119903119894119888119890

119905minus 119862119897119900119904119890119875119903119894119888119890

119905minus1

119862119897119900119904119890119875119903119894119888119890119905minus1

119875119905= 119862119897119900119904119890119875119903119894119888119890

119905

lowast (1 minus 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816)

minus 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816

119875119905minus1

= 119862119897119900119904119890119875119903119894119888119890119905minus1

lowast (1 + 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816)

+ 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816

119877119890119905119905=119875119905minus 119875119905minus1

119875119905minus1

(5)

where 119862119897119900119904119890119875119903119894119888119890119905

denotes the 119905-th closing price119879119903119886119889119890119878119894119892119899119886119897

119905denotes the 119905-th trading signal 119875

119905denotes

the 119905-th executing price and 119877119890119905119905denotes the 119905-th return rate

We propose a backtesting algorithm with transaction costbased on the above analysis as is shown in Algorithm 3

18 Mathematical Problems in Engineering

Input TS TS is trading signals of a stocks s is slippagec c is transparent transaction cost

Output WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) WR=NULL ARR=NULL ASR=NULL MDD=NULL(3) for (i in 1 N) (4) Stock Data=Stock Code List[i](5) ClosePricet=Stock Data [ldquoClosing Pricerdquo](6) Pt =ClosePricet lowast(1-clowastabs(TSt-TSt-1)) - slowastabs(TSt-TSt-1)(7) Pt-1 =ClosePricetlowast(1+clowastabs(TSt-TSt-1)) + slowastabs(TSt-TSt-1)(8) Rett= (Pt- Pt-1) Pt Ret is the return rate series(9) TDRR=lag (TS)lowastRet TDRR is the daily return through trading(10) WR[i]=sum (TDRRgt0)sum(TDRR =0)(11) ARR[i]=Returnannualized (TDRR)(12) ASR[i]=SharpeRatioannualized (TDRR)(13) MDD[i]=maxDrawDown (TDRR)(14) WR=c (WR WR[i])(15) ARR=c (ARR ARR[i])(16) ASR=c (ASR ASR[i])(17) MDD=c (MDD MDD[i])(18) (19) return (WR ARR ASR MDD)

Algorithm 3 Backtesting algorithm with transaction cost in R language

62 Analysis of Impact of Transaction Cost on the TradingPerformance of SPICS Transaction cost is one of the mostimportant factors affecting trading performance In US stocktrading transparent transaction cost can be charged accord-ing to a fixed fee per order or month or a floating fee basedon the volume and turnover of each transaction Sometimescustomers can also negotiate with broker to determinetransaction cost The transaction cost charged by differentbrokers varies greatly Meanwhile implicit transaction costis not known beforehand and the estimations of them arevery complex Therefore we assume that the percentageof turnover is the transparent transaction cost for ease ofcalculation In the aspect of implicit transaction cost we onlyconsider the impact of slippage on trading performance

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 24 WR is decreasing with the increase oftransaction cost for any trading algorithm which is intuitiveWhen the transaction cost is set to (s c) = (004 0005) theWR of each algorithm is the lowest Compared with setting(s c) = (0 0) the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR and SVM to XGB are reduced by580 597 591 1583 1804 1395 2171 16042216 1854 1850 and 2597 respectively ThereforeMLP DBN and SAE are more tolerant to transaction costGenerally speaking the DNN models have stronger capacityto accommodate transaction cost than the traditional MLmodels From the single trading algorithm such as MLP ifwe do not consider slippage ie s=0 the average WR ofMLP is 05510 under transaction cost structures (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not considertransparent transaction cost ie c=0 the averageWRofMLP

is 05618 under transaction cost structures (s1 c0) (s2 c0)(s3 c0) (s4 c0) so transparent transaction cost has greaterimpact than slippageThroughmultiple comparative analysisthe WR under the transaction cost structure (s1 c0) is notsignificantly different from the WR without transaction costfor MLP DBN and SAETheWR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the WR under the transaction cost structure (s1 c0) (s2 c0) are not significantly different from theWRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 25 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the lowest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 4031 4157 and 4093 respectivelywhile the ARR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin accounts For a general setting of s and c ie (s c) = (0020003) ARR of MLP DBN and SAE decrease by 23262400 and 2361 respectively while the ARR of otheralgorithms decrease by more than 50 and that of CARTand XGB decrease bymore than 100ThereforeMLP DBNand SAE are more tolerant to high transaction cost Fromsingle trading algorithm such as RNN if we do not considerslippage ie s=0 the average ARR of RNN is 01434 under

Mathematical Problems in Engineering 19

Table24Th

eWRof

SPICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

05676

05680

05683

05843

05825

05844

05266

05930

05912

05859

05831

05891

(s0c1)

05615

05618

05621

05669

05626

05694

05052

05752

05663

05654

05630

05599

(s0c2)

05560

05560

05564

05507

05442

05553

04847

05585

05429

05463

05438

05324

(s0c3)

05507

05506

05510

05353

05269

05418

04652

05424

05205

05278

05253

05061

(s0c4)

05457

05454

05460

05206

05101

05289

044

7005277

04996

05105

05084

04818

(s0c5)

05410

05407

05412

05071

04946

05170

04303

05138

04803

04947

04924

04594

(s1c0)

056

49056

53056

5605778

05751

05785

05190

058

61058

2405782

05759

05788

(s1c1)

05594

05597

05600

05619

05571

05648

04991

05700

05597

05595

05574

05521

(s1c2)

05539

05539

05544

05458

05389

05508

04788

05534

05364

05406

05383

05249

(s1c3)

05487

05486

05491

05305

05215

05375

04597

05375

05141

05223

05200

04988

(s1c4)

05438

05436

05441

05163

05052

05249

044

1805231

04938

05054

05034

04750

(s1c5)

05394

05390

05396

05032

04902

05132

04255

05097

04751

04900

04880

04532

(s2c0)

05628

05631

05635

05729

056

9705741

05134

058

1105758

05726

05704

05713

(s2c1)

05573

05574

05578

05568

05515

05602

04931

05647

05527

05535

05515

05442

(s2c2)

05518

05518

05523

05408

05336

05463

04729

05482

05297

05349

05326

05172

(s2c3)

05469

05467

05472

05260

05164

05334

04543

05330

05082

05171

05150

04918

(s2c4)

05421

05417

05423

05120

05004

05209

04368

05187

04881

05004

04986

046

85(s2c5)

05377

05373

05379

04993

04858

05096

04209

05055

04699

04855

04835

044

73(s3c0)

05606

05609

05612

05678

05640

05694

05074

05759

05690

05668

05646

05635

(s3c1)

05552

05553

05558

05518

05460

05556

04872

05595

05460

05478

05459

05365

(s3c2)

05499

05498

05503

05362

05284

05422

046

7505434

05233

05295

05273

05099

(s3c3)

05450

05448

05453

05216

05114

05292

04491

05284

05020

05120

05098

04849

(s3c4)

05405

05401

05407

05080

04960

05172

04321

05146

04827

04959

04940

04622

(s3c5)

05362

05357

05363

04955

04816

05063

04166

05017

04651

04815

04793

044

17(s4c0)

05587

05589

05593

05630

05588

05652

05019

05710

05627

05613

05593

05562

(s4c1)

05533

05533

05537

05470

05407

05513

04815

05544

05395

05424

05404

05290

(s4c2)

05480

05479

05484

05316

05232

05380

04620

05386

05171

05242

05220

05026

(s4c3)

05432

05429

05435

05172

05067

05253

044

4005241

04964

05070

05051

04782

(s4c4)

05388

05384

05391

05041

04917

05137

04274

05106

04775

04914

04897

04564

(s4c5)

05347

05341

05347

04918

04774

05029

04123

04979

046

0204773

04752

04361

20 Mathematical Problems in Engineering

Table25Th

eARR

ofSP

ICSford

ailytradingwith

different

transactioncost

Ther

esultthatthere

isno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

03332

03296

03325

02943

02920

02934

03317

02975

03133

02942

03067

03041

(s0c1)

03128

030

8703118

02439

02327

02521

02266

02496

02384

02336

02400

02137

(s0c2)

02924

02879

02912

01936

01735

02108

01216

02017

01636

01731

01734

01234

(s0c3)

02721

02672

02706

01433

0114

301697

00168

01539

00889

01126

01070

00333

(s0c4)

02519

02464

02500

00931

00553

01285

-00878

01062

00143

00522

004

06-00567

(s0c5)

02316

02257

02294

00430

-00037

00875

-019

2400586

-00602

-0008

-00257

-014

66(s1c0)

03249

03212

03242

027

7802729

02794

029

53028

18028

9802747

028

5502762

(s1c1)

03046

03004

03035

02274

02136

02381

01902

02339

02149

02141

02188

01859

(s1c2)

02842

02796

02829

01771

01544

01969

00853

01861

01401

01536

01523

00957

(s1c3)

02639

02588

02623

01269

00953

01557

-00195

01383

00654

00931

00858

000

56(s1c4)

02437

02381

02417

00767

00363

0114

6-012

41009

06-00091

00328

00195

-00844

(s1c5)

02234

02174

02211

00266

-00226

00735

-02285

00430

-00836

-00275

-0046

8-01742

(s2c0)

03167

03129

03159

026

1302538

026

54025

89026

61026

6302551

026

43024

84(s2c1)

02964

02921

02952

02110

01946

02241

01539

02182

01914

01946

01977

01581

(s2c2)

0276

02713

02746

01607

01354

01829

00490

01704

0116

701341

01312

006

79(s2c3)

02557

02505

02540

0110

400763

01418

-00557

01227

004

2000737

006

47-00221

(s2c4)

02355

02298

02334

006

0300173

01007

-016

0300750

-00325

00134

-00016

-01120

(s2c5)

02153

02091

02129

00102

-00416

00597

-0264

700274

-010

69-00469

-00678

-02018

(s3c0)

030

85030

46030

7602448

02348

02514

02225

02504

02428

02356

02431

02206

(s3c1)

02881

02838

02869

01945

01756

02102

0117

502026

01680

01751

01765

01304

(s3c2)

02678

02630

02663

01442

01164

01690

00127

01548

00933

0114

601100

004

02(s3c3)

02476

02422

02457

00940

00574

01279

-00919

01071

00187

00543

00436

-00498

(s3c4)

02273

02215

02252

00439

-00016

00868

-019

6400595

-00558

-0006

-00227

-013

97(s3c5)

02071

02008

02047

-00062

-0060

5004

58-0300

800119

-013

02-00662

-00889

-02294

(s4c0)

03003

02962

02993

02284

02157

02374

01862

02348

02193

02161

02219

01929

(s4c1)

02799

02754

02786

01781

01565

01962

00813

01870

01445

01556

01554

01026

(s4c2)

02597

02547

02580

01278

00974

01551

-00235

01392

00699

00952

00889

00125

(s4c3)

02394

02339

02375

00776

00384

0114

0-012

8100915

-0004

700349

00226

-00774

(s4c4)

02192

02132

02169

00275

-00205

00729

-02326

00439

-00792

-00254

-00437

-016

73(s4c5)

01989

01926

01964

-00225

-00794

00319

-033

69-00037

-015

35-00856

-010

99-02570

Mathematical Problems in Engineering 21

the transaction cost structures (s0 c1) (s0 c2) (s0 c3) (s0c4) (s0 c5) if we do not consider transparent transactioncost ie c=0 the average ARR of RNN is 02531 under thetransaction cost structure (s1 c0) (s2 c0) (s3 c0) (s4c0) so transparent transaction cost has greater impact thanslippage Through multiple comparative analysis the ARRunder the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s0 c1) are not significantly different from the ARRwithout transaction cost for MLP DBN and SAE the ARRunder all other transaction cost structures are significantlysmaller than theARRwithout transaction cost For all tradingalgorithms except for MLP DBN and SAE the ARR underthe transaction cost structures (s1 c0) (s2 c0) are notsignificantly different from the ARR without transactioncost the ARR under all other transaction cost structures aresignificantly smaller than the ARR without transaction cost

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 26 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theASR of each algorithm is the lowest Compared with settingwithout transaction cost the ASR of MLP DBN and SAEreduce by 3997 4123 and 4066 respectively while theASR of other trading algorithms reduce by more than 90compared with the case of no transaction cost Thereforeexcessive transaction cost will significantly reduce ASR Fora general setting of s and c ie (s c) = (002 0003) theASR of MLP DBN and SAE decrease by 2262 2336and 2302 respectively while the ASR of other algorithmsdecrease by more than 50 the ASR of CART and XGBdecrease by more than 100Therefore MLP DBN and SAEare more tolerant to transaction cost From single tradingalgorithm such as NB if we do not consider slippage ies=0 the average ASR of NB is 08052 under the transactioncost structure (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5)if we do not consider transparent transaction cost ie c=0the average ASR of NB is 14182 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has greater impact than slippage Throughmultiple comparative analysis the ASR under the transactioncost structures (s1 c0) (s2 c0) (s3 c0) (s0 c1) are notsignificantly different from the ASR without transaction costfor MLP DBN and SAE the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the ASR under the transaction cost structures(s1 c0) (s2 c0) are not significantly different from the ASRwithout transaction cost the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 27 MDD increases with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the settings without transaction cost theMDD of MLP DBN and SAE increase by 932 1108 and

1032 respectively The MDD of other trading algorithmsincrease by more than 80 compared with those withoutconsidering transaction costTherefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 483 580 and 533respectively while the MDD of other algorithms increase bymore than 35 and theMDDofCART RF andXGB increasebymore than 100Therefore MLP DBN and SAE are moretolerant to transaction cost As awhole theDNNmodels havestronger capacity to accommodate transaction cost than thetraditional ML models From single trading algorithm suchas GRU if we do not consider slippage ie s=0 the averageMDD of GRU is 04459 under the transaction cost structures(s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do notconsider transparent transaction cost ie c=0 the averageMDD of GRU is 03559 under the transaction cost structures(s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparent transactioncost has greater impact than slippage Through multiplecomparative analysis the MDD under any the transactioncost structure is not significantly different from the MDDwithout transaction cost for MLP DBN and SAE For alltrading algorithms except for MLP DBN and SAE such asLR the MDD under the transaction cost structures (s0 c1)(s1 c0) (s2 c0) (s3 c0) are not significantly different fromthe MDD without transaction cost the MDD under all othertransaction cost structures are significantly greater than theMDD without transaction cost

Through the analysis of the Table 27 performance eval-uation indicators we find that trading performance afterconsidering transaction cost will be worse than that withoutconsidering transaction cost as is in actual trading situationIt is noteworthy that the performance changes of DNNalgorithms especially MLP DBN and SAE are very smallafter considering transaction cost This shows that the threealgorithms have good tolerance to changes of transactioncost Especially for the MDD of the three algorithms thereis no significant difference with that with no transactioncost So we can consider applying them in actual tradingMeanwhile we conclude that the transparent transactioncost has greater impact on the trading performances thanthe slippage for SPICS This is because the prices of SPICSare too high when the transparent transaction cost is setto a certain percentage of turnover In actual transactionsspecial attention needs to be paid to the fact that the trans-action performance under most transaction cost structuresis significantly lower than the trading performance withoutconsidering transaction cost It is worth noting that theperformance of traditional ML algorithm is not worse thanthat ofDNNalgorithmswithout considering transaction costwhile the performance of DNN algorithms is better than thatof traditional ML algorithms after considering transactioncost

63 Analysis of Impact of Transaction Cost on the TradingPerformance of CSICS Similar to Section 62 we will discussthe impact of transaction cost on trading performance ofCSICS in the followings In the Chinese A-share marketthe transparent transaction cost is usually set to a certain

22 Mathematical Problems in Engineering

Table26Th

eASR

ofSP

ICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

1546

815

412

15502

15764

15571

15828

13927

16237

16763

15818

16018

16298

(s0c1)

1456

214

478

14577

1300

012

317

13565

09346

13554

12650

12472

12456

11294

(s0c2)

13639

13527

13635

10191

09015

11262

04657

10822

08482

09074

08846

06236

(s0c3)

12702

12561

12679

07355

05690

08929

-00085

08061

04298

05652

05216

0118

2(s0c4)

11751

11581

11709

04511

02366

06580

-04823

05291

00139

02234

01596

-03812

(s0c5)

1079

10591

10728

01678

-00931

04227

-09500

02534

-039

59-01152

-019

87-08696

(s1c0)

15121

1505

715

149

1492

714

606

15119

1244

915

424

1558

214

825

14974

1488

6(s1c1)

14208

14116

14217

12146

11334

12841

07823

12722

1144

711459

11394

09859

(s1c2)

13279

13159

13270

09325

08020

10526

03105

09977

07267

08048

07772

04792

(s1c3)

12337

12188

12308

064

8204690

08185

-016

4607209

03082

04622

04139

-00257

(s1c4)

11382

11204

11333

03637

01368

05831

-06374

04438

-010

6801208

00524

-052

31(s1c5)

10417

10210

10348

00807

-019

2003478

-110

2501686

-05146

-02169

-0304

7-10083

(s2c0)

1477

1469

914

792

1408

113

632

1440

310

946

1460

114

390

1382

213

922

1346

2(s2c1)

13851

13752

13854

11285

10343

12111

06283

11883

10237

10439

10325

08416

(s2c2)

12916

12789

12901

08454

07021

09785

01547

09128

060

4907019

06696

03346

(s2c3)

11969

11812

11934

05607

03688

07437

-032

0506355

01868

03591

03063

-016

90(s2c4)

11010

10825

10955

02763

00372

05081

-07916

03586

-02268

00183

-00545

-06639

(s2c5)

1004

109827

09967

-0006

-02905

02729

-12533

00841

-06323

-031

79-04101

-114

54(s3c0)

14415

14337

14432

13227

12650

13679

09425

13770

13189

12810

12862

12030

(s3c1)

13490

13384

13488

10419

09348

11375

04733

11039

09023

09413

09252

06971

(s3c2)

12551

12416

12529

07580

060

19090

40-00013

08275

04832

05988

05618

01904

(s3c3)

11599

11435

11558

04731

02688

066

88-04757

05500

00658

02562

01988

-031

16(s3c4)

10636

10443

10575

01891

-00620

04331

-0944

202735

-0346

0-00836

-016

08-08034

(s3c5)

09664

09443

09584

-00924

-03883

01982

-14018

000

00-074

89-04183

-05146

-12808

(s4c0)

14058

13972

1406

812

368

11662

12950

07892

12933

11983

11793

11796

10591

(s4c1)

13127

13013

13119

09549

08350

10634

03180

10190

07807

08386

08177

05527

(s4c2)

12183

1204

12155

06705

05018

08293

-015

6807421

03617

04958

04542

004

68(s4c3)

11226

11055

11179

03857

01691

05938

-06295

046

47-00545

01537

00918

-04529

(s4c4)

1026

1006

10193

01021

-016

0703582

-10948

01888

-0464

2-018

49-02665

-09413

(s4c5)

09286

09057

09199

-017

83-04853

01238

-15478

-00836

-0864

2-05177

-06182

-14142

Mathematical Problems in Engineering 23

Table 27 The MDD of SPICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 03583 03584 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338(s0 c1) 03629 03638 03594 03779 03986 03636 04072 03712 03843 03963 03972 04203(s0 c2) 03677 03695 03647 04302 04707 03968 05168 04127 04842 04729 04787 05735(s0 c3) 03727 03756 03703 04990 05639 04376 06564 04709 06172 05682 05844 07335(s0 c4) 03781 03821 03764 05767 06612 04873 07804 05424 07377 06653 06913 08447(s0 c5) 03839 03890 03828 06529 0746 05444 08730 06162 08272 07501 07808 09118(s1 c0) 03596 03600 03560 03500 036130 03446 03574 03502 03414 03585 03569 03540(s1 c1) 03642 03655 03609 03907 04156 03717 04320 03814 04067 04154 04170 04541(s1 c2) 03691 03712 03662 04466 04936 04066 05534 04270 05172 04971 05049 06168(s1 c3) 03742 03774 03720 05183 05895 04495 06928 04885 06499 05937 06129 07662(s1 c4) 03796 03839 03781 05961 06842 05013 08105 05610 07631 06884 07161 08649(s1 c5) 03856 03909 03847 0671 07646 05595 08946 06342 08451 07691 0800 09235(s2 c0) 03609 03615 03573 03607 03756 03517 03770 03586 03586 03739 03727 03787(s2 c1) 03656 03671 03623 04047 04349 03805 04627 03929 04339 04365 04397 04929(s2 c2) 03705 03729 03678 04642 05176 04171 05916 04424 05504 05218 05327 06577(s2 c3) 03756 03792 03736 05377 06143 04624 07277 05067 06805 06183 06402 07939(s2 c4) 03812 03859 03799 06155 07056 05161 08380 05796 07856 07099 07388 08816(s2 c5) 03873 03930 03866 06887 07816 05751 09126 06517 08606 07864 08172 09331(s3 c0) 03622 03631 03588 03729 03912 03594 04004 03685 03795 03909 03909 04081(s3 c1) 03669 03687 03639 04200 04555 03901 04966 04062 04622 04587 04642 05334(s3 c2) 03719 03746 03694 04826 05423 04286 06295 04589 05833 05465 05607 06936(s3 c3) 03772 03811 03754 05572 06377 04762 07609 05248 07081 06420 06657 08175(s3 c4) 03829 03879 03818 06341 07254 05314 08620 05980 08054 07300 07593 08956(s3 c5) 03894 03954 03888 07056 07972 05909 09275 06689 08740 08022 08325 09412(s4 c0) 03635 03647 03602 03861 04082 03678 04274 03798 04015 04096 04114 04396(s4 c1) 03683 03704 03654 04362 04774 04005 05325 04211 04908 04814 04894 05730(s4 c2) 03734 03765 03712 05013 05664 04410 06667 04758 06142 05707 05875 07253(s4 c3) 03790 03833 03775 05765 06600 04905 07906 05429 07330 06644 06894 08375(s4 c4) 03851 03904 03841 06521 07439 05470 08824 06162 08230 07485 07782 09074(s4 c5) 03917 03981 03913 07218 08115 06067 09395 06857 08858 08165 08463 09480

percentage of turnover and it is the same as the assumptionin the experimental settings As in the US stock market thesmallest unit of price change is 001 (one tick) It is reasonableto set slippage to be 001-005 Of course it should be notedthat the prices fluctuation may be more intense when closingthan that in the middle of a trading day

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 28 the WR is decreasing with the increaseof transaction cost for any trading algorithm When thetransaction cost is set to (s c) = (004 0005) the WR of eachalgorithm is the smallest Comparedwith the settings withouttransaction cost the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR SVM and XGB are reduced by671 688 697 2269 1726 1548 2430 14912484 2112 2112 and 2919 respectively For a generalsetting of s and c ie (s c) = (002 0003) the WR ofMLP DBN and SAE decrease by 410 420 and 430respectively while the WR of other algorithms decrease bymore than 9 the WR of CART RF and XGB decrease by

more than 15 Therefore MLP DBN and SAE are moretolerant to transaction cost From single trading algorithmsuch as LSTM if we do not consider slippage ie s=0 theaverage WR of DBN is 05417 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage WR of LSTM is 05304 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the WR under the transactioncost structures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the WR without transaction cost for MLPDBN SAE and NB the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN SAE and NB the WR under the transaction coststructure (s0 c1) is not significantly different from the WRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

24 Mathematical Problems in Engineering

Table 28 The WR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803(s0 c1) 05523 05527 05525 05525 05608 05620 05009 05227 05612 05665 05571 05595(s0 c2) 05488 05492 05489 05389 05512 05535 04879 05149 05460 05542 05445 05411(s0 c3) 05453 05456 05452 05258 05414 05451 04747 05068 05313 05418 05320 05234(s0 c4) 05417 05419 05414 05127 05320 05368 04622 04991 05172 05297 05202 05067(s0 c5) 05383 05383 05379 05004 05230 05286 04504 04917 05036 05180 05088 04905(s1 c0) 05494 05499 05497 05444 05541 05558 04925 05170 05520 05584 05492 05488(s1 c1) 05456 05459 05456 05286 05424 05456 04775 05080 05342 05437 05345 05275(s1 c2) 05421 05423 05420 05161 05335 05377 04654 05007 05207 05320 05231 05110(s1 c3) 05386 05388 05383 05036 05246 05296 04530 04931 05065 05205 05116 04946(s1 c4) 05353 05354 05349 04915 05156 05218 04419 04861 04937 05095 05007 04795(s1 c5) 05323 05323 05317 04808 05076 05148 04315 04796 04817 04995 04905 04652(s2 c0) 05431 05434 05431 05219 05368 05403 04707 05036 05269 05374 05286 05189(s2 c1) 05395 05397 05393 05078 05266 05314 04573 04956 05115 05242 05154 05005(s2 c2) 05360 05361 05357 04960 05181 05237 04458 04886 04985 05134 05046 04853(s2 c3) 05331 05331 05326 04850 05100 05167 04352 04818 04864 05031 04945 04711(s2 c4) 05300 05300 05293 04743 05018 05093 04252 04752 04746 04931 04846 04572(s2 c5) 05273 05271 05266 04648 04946 05029 04159 04692 04639 04838 04755 04445(s3 c0) 05373 05374 05371 05019 05216 05265 04514 04917 05049 05186 05098 04932(s3 c1) 05341 05341 05336 04902 05128 05188 04399 04846 04917 05074 04990 04775(s3 c2) 05312 05312 05306 04798 05052 05122 04303 04782 04804 04977 04896 04644(s3 c3) 05281 05281 05275 04696 04976 05049 04206 04718 04689 04879 04799 04509(s3 c4) 05252 05251 05245 04598 04901 04984 04110 04657 04581 04785 04707 04378(s3 c5) 05226 05223 05218 04510 04833 04924 04023 04602 04481 04701 04621 04264(s4 c0) 05325 05325 05321 04860 05089 05150 04360 04816 04870 05030 04949 04723(s4 c1) 05294 05294 05289 04753 05010 05079 04258 04750 04752 04928 04849 04588(s4 c2) 05266 05265 05259 04653 04937 05013 04164 04690 04642 04838 04761 04458(s4 c3) 05238 05236 05230 04562 04864 04948 04073 04632 04541 04747 04672 04336(s4 c4) 05211 05208 05203 04475 04798 04891 03985 04577 04440 04662 04586 04218(s4 c5) 05186 05182 05176 04392 04733 04832 03901 04524 04348 04582 04509 04109

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 29 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the smallest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 5073 5175 and 5225 respectivelyWhile the ARR of other trading algorithms decrease bymore than 100 compared with those algorithms withouttransaction cost Therefore excessive transaction cost canlead to serious losses in the accounts For a general settingof s and c ie (s c) = (002 0003) ARR of MLP DBNand SAE decrease by 2741 2797 and 2825 respectivelywhile the ARR other algorithms decrease by more than 50and that of CART NB RF and XGB decrease by more than100 Therefore MLP DBN and SAE are more tolerant totransaction cost From single trading algorithm such as SAEif we do not consider slippage ie s=0 the average ARR ofSAE is 05040 under the transaction cost structure (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not consider

transparent transaction cost ie c=0 the averageARRof SAEis 04468 under the transaction cost structures (s1 c0) (s2c0) (s3 c0) (s4 c0) so transparent transaction cost hassmaller impact than slippage Through multiple comparativeanalysis the ARR under the transaction cost structures (s0c1) (s0 c2) (s0 c3) (s0 c1) (s1 c1) are not significantlydifferent from the ARR without transaction cost for MLPDBN and SAE the ARR under all other transaction coststructures are significantly smaller than the ARR withouttransaction cost For RNN LSTM GRU CART RF LR andSVM the ARR under the transaction cost structures (s0c1) (s0 c2) (s1 c0) are not significantly different fromthe ARR without transaction cost the ARR under all othertransaction cost structures are significantly smaller than theARR without transaction cost For NB and XGB the ARRunder the transaction cost structures (s0 c1) (s1 c0) arenot significantly different from the ARR without transactioncost the ARR under all other transaction cost structuresare significantly smaller than the ARR without transactioncost

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 5: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

Mathematical Problems in Engineering 5

ML Algorithm

44-dim

2000

-dim

44-dim

44-dim

44-dim

44-dim

44-dim

44-dim

250-

dim

5-di

m25

0-di

m5-

dim

250-

dim

5-di

m

1-dim

1-dim

1-dim

1-dim

5-di

m5-

dim

5-di

m

1750

-dim

ConcatenateML Algorithm

ML Algorithm

Raw

Inpu

t Dat

a

Figure 2The schematic diagram of WFA (training and testing)

Input Stock SymbolsOutput Trading Signals(1) N=Length of Stock Symbols(2) L=Length of Trading Days(3) P=Length of Features(4) k= Length of Training Dataset for WFA(5) n= Length of Sliding Window for WFA(6) for (i in 1 N) (7) Stock=Stock Symbols[i](8) M=(L-k)n(9) Trading Signal=NULL(10) for (j in 1M) (11) Dataset= Stock[(k+nlowast(j-1))(k+n+nlowast(j-1)) 1(P+1)](12) Train=Dataset[1k1(1+P)](13) Test= Dataset[(k+1)(k+n)1P](14) Model=ML Algorithm(Train)(15) Probability=Model(Test)(16) if (Probabilitygt=05) (17) Trading Signal0=1(18) else (19) Trading Signal0=0(20) (21) (22) Trading Signal=c (Trading Signal Trading Signal0)(23) (24) return (Trading Signal)

Algorithm 1 Generating trading signal in R language

6 Mathematical Problems in Engineering

In this paper ldquoUPrdquo is the profit source of our tradingstrategiesThe classification ability ofML algorithm is to eval-uate whether the algorithms can recognize ldquoUPrdquo Thereforeit is necessary to use PR and RR to evaluate classificationresults These two evaluation indicators are initially appliedin the field of information retrieval to evaluate the relevanceof retrieval results

PR is a ratio of the number of correctly predicted UP toall predicted UP That is as follows

119875119877 =119879119880

(119879119880 + 119865119880)(2)

High PR means that ML algorithms can focus on ldquoUPrdquorather than ldquoDOWNrdquo

RR is the ratio of the number of correctly predicted ldquoUPrdquoto the number of actually labeled ldquoUPrdquo That is as follows

119875119877 =119879119880

(119879119880 + 119865119863)(3)

High RR can capture a large number of ldquoUPrdquo and beeffectively identified In fact it is very difficult to present analgorithm with high PR and RR at the same time Thereforeit is necessary to measure the classification ability of theML algorithm by using some evaluation indicators whichcombine PR with RR F1-Score is the harmonic average ofPR and AR F1 is a more comprehensive evaluation indicatorThat is as follows

1198651= 2 lowast 119875119877 lowast

119860119877

(119875119877 + 119860119877)(4)

Here it is assumed that theweights of PR andRR are equalwhen calculating F1 but this assumption is not always correctIt is feasible to calculate F1 with different weights for PR andRR but determining weights is a very difficult challenge

AUC is the area under ROC (Receiver Operating Charac-teristic) curve ROC curve is often used to check the tradeoffbetween finding TU and avoiding FU Its horizontal axisis FU rate and its vertical axis is TU rate Each point onthe curve represents the proportion of TU under differentFU thresholds [36] AUC reflects the classification ability ofclassifier The larger the value the better the classificationability It is worth noting that two different ROC curves maylead to the same AUC value so qualitative analysis should becarried out in combination with the ROC curve when usingAUCvalue In this paper we use R language package ldquoROCRrdquoto calculate AUC

42 Performance Evaluation Indicator Performance evalua-tion indicator is used for evaluating the profitability and riskcontrol ability of trading algorithms In this paper we usetrading signals generated by ML algorithms to conduct thebacktesting and apply the WR ARR ASR and MDD to dothe trading performance evaluation [34] WR is a measureof the accuracy of trading signals ARR is a theoretical rateof return of a trading strategy ASR is a risk-adjusted returnwhich represents return from taking a unit risk [37] and therisk-free return or benchmark is set to 0 in this paper MDDis the largest decline in the price or value of the investmentperiod which is an important risk assessment indicator

43 Backtesting Algorithm Using historical data to imple-ment trading strategy is called backtesting In research andthe development phase of trading model the researchersusually use a new set of historical data to do backtesting Fur-thermore the backtesting period should be long enoughbecause a large number of historical data can ensure that thetrading model can minimize the sampling bias of data Wecan get statistical performance of tradingmodels theoreticallyby backtesting In this paper we get 1750 trading signals foreach stock If tomorrowrsquos trading signal is 1 we will buy thestock at todayrsquos closing price and then sell it at tomorrowrsquosclosing price otherwise we will not do stock trading Finallywe get AR PR RR F1 AUC WR ARR ASR and MDD byimplementing backtesting algorithm based on these tradingsignals

5 Comparative Analysis ofDifferent Trading Algorithms

51 Nonparametric Statistical Test Method In this part weuse the backtesting algorithm(Algorithm 2) to calculate theevaluation indicators of different trading algorithms In orderto test whether there are significant differences betweenthe evaluation indicators of different ML algorithms thebenchmark indexes and the BAH strategies it is necessaryto use analysis of variance and multiple comparisons to givethe answers Therefore we propose the following nine basichypotheses for significance test in which Hja (119895 = 1 2 3 45 6 7 8 9) are the null hypothesis and the correspondingalternative assumptions areHjb (119895 = 1 2 3 4 5 6 7 8 9)Thelevel of significance is 005

For any evaluation indicator 119895 isin 119860119877 119875119877 119877119877 1198651 119860119880119862119882119877119860119877119877 119860119878119877119872119863119863 and any trading strategy 119894 isin 119872119871119875119863119861119873 119878119860119864 119877119873119873 119871119878119879119872 119866119877119880 119871119877 119878119881119872 119873119861119862119860119877119879 119877119865119883119866119861119861119860119867 119861119890119899119888ℎ119898119886119903119896 119894119899119889119890119909 the null hypothesis a is Hjaalternative hypotheses b is Hjb (119895 = 1 2 3 4 5 6 7 8 9represent AR PR RR F1 AUC WR ARR ASR MDDrespectively)

Hja the evaluation indicator j of all strategies are thesameHjb the evaluation indicator j of all strategies are notthe same

It is worth noting that any evaluation indicator of alltrading algorithm or strategy does not conform to the basichypothesis of variance analysisThat is it violates the assump-tion that the variances of any two groups of samples are thesame and each group of samples obeys normal distributionTherefore it is not appropriate to use t-test in the analysisof variance and we should take the nonparametric statisticaltest method instead In this paper we use the Kruskal-Wallisrank sum test [38] to carry out the analysis of variance If thealternative hypothesis is established we will need to furtherapply the Nemenyi test [39] to do the multiple comparisonsbetween trading strategies

52 Comparative Analysis of Performance of Different TradingStrategies in SPICS Table 4 shows the average value of

Mathematical Problems in Engineering 7

Input TS TS is trading signals of a stockOutput AR PR RR F1 AUC WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) Bt=Benchmark Index [ldquoClosing Pricerdquo] B is the closing price of benchmark index(3) WR=NULL ARR=NULL ASR=NULL MDD=NULL(4) for (i in 1 N) (5) Stock Data=Stock Code List[i](6) Pt=Stock Data [ldquoClosing Pricerdquo](7) Labelt= Stock Data [ldquoLabelrdquo](8) BDRRt=(Bt-Bt-1) Bt-1 BDRR is the daily return rate of benchmark index(9) DRRt= (Pt-Pt-1)Pt-1 DRR is daily return rateThat is daily return rate of BAH strategy(10) TDRRt=lag (TSt)lowastDRRt TDRR is the daily return through trading(11) Table=Confusion Matrix(TS Label)(12) AR[i]=sum(adj(Table))sum(Table)(13) PR[i]=Table[2 2]sum(Table[ 2])(14) RR[i]=Table[2 2]sum(Table[2 ])(15) F1=2lowastPR[i]lowastRR[i](PR[i]+RR[i])(16) Pred=prediction (TS Label)(17) AUC[i]=performance (Pred measure=ldquoaucrdquo)yvalues[[1]](18) WR[i]=sum (TDRRgt0)sum(TDRR =0)(19) ARR[i]=Returnannualized (TDRR) TDRR BDRR or DRR can be used(20) ASR[i]=SharpeRatioannualized (TDRR) TDRR BDRR or DRR can be used(21) MDD[i]=maxDrawDown (TDRR) TDRR BDRR or DRR can be used(22) AR=c (AR AR[i])(23) PR=c (PR PR[i])(24) RR=c (RR RR[i])(25) F1=c (F1 F1[i])(26) AUC=c (AUC AUC[i])(27) WR=c (WR WR[i])(28) ARR=c (ARR ARR[i])(29) ASR=c (ASR ASR[i])(30) MDD=c (MDD MDD[i])(31) (32) Performance=cbind (AR PR RR F1 AUC WR ARR ASR MDD)(33) return (Performance)

Algorithm 2 Backtesting algorithm of daily trading strategy in R language

Table 4 Trading performance of different trading strategies in the SPICS Best performance of all trading strategies is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGBAR mdash mdash 05205 05189 05201 05025 05013 04986 06309 05476 06431 06491 06235 06600PR mdash mdash 07861 07764 07781 05427 05121 04911 06514 05270 06595 06474 06733 06738RR mdash mdash 05274 05263 05273 05245 05253 05239 06472 05762 06599 06722 06325 06767F1 mdash mdash 06258 06217 06229 05332 05183 05065 06491 05480 06595 06591 06517 06751AUC mdash mdash 05003 05001 05002 04997 05005 04992 06295 05489 06418 06491 06199 06590WR 05450 05235 05676 05680 05683 05843 05825 05844 05266 05930 05912 05859 05831 05891ARR 01227 01603 03333 03298 03327 02945 02921 02935 03319 02976 03134 02944 03068 03042ASR 08375 06553 15472 15415 15506 15768 15575 15832 13931 16241 16768 15822 16022 16302MDD 01939 04233 03584 03585 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338

various trading algorithms in AR PR RR F1 AUC WRARR ASR and MDD We can see that the AR RR F1 andAUC of XGB are the greatest in all trading algorithms TheWR of NB is the greatest in all trading strategies The ARRof MLP is the greatest in all trading strategies including thebenchmark index (SampP 500 index) and BAH strategy TheASR of RF is the greatest in all trading strategies TheMDDofthe benchmark index is the smallest in all trading strategies

It is worth noting that the ARR and ASR of all ML algorithmsare greater than those of BAH strategy and the benchmarkindex

(1) Through the hypothesis test analysis of H1a and H1bwe can obtain p valuelt22e-16

Therefore there are statistically significant differencesbetween the AR of all trading algorithms Therefore we needto make multiple comparative analysis further as shown in

8 Mathematical Problems in Engineering

Table 5Multiple comparison analysis between theAR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 10000GRU 00000 00000 00000 08273 09811CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00232 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 07649SVM 00000 00000 00000 00000 00000 00000 06057 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00002 02010 00000

Table 6Multiple comparison analysis between the PR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 09999SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00034GRU 00000 00000 00000 00000 01472CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 07869 05786 00000 00000RF 00000 00000 00000 00000 00000 00000 08056 00000LR 00000 00000 00000 00000 00000 00000 09997 00000 02626SVM 00000 00000 00000 00000 00000 00000 00008 00000 03104 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00491 00000 09999

Table 5 The number in the table is a p value of any two algo-rithms of Nemenyi test When p valuelt005 we think thatthe two trading algorithms have a significant differenceotherwise we cannot deny the null assumption that the meanvalues of AR of the two algorithms are equal From Tables 5and 4 we can see that the AR of all DNN models are signif-icantly lower than those of all traditional MLmodelsTheARof MLP DBN and SAE are significantly greater than those ofRNN LSTM and GRU There are no significant differencesamong the AR of MLP DBN and SAE There are no sig-nificant differences among the AR of RNN LSTM and GRU

(2) Through the hypothesis test analysis of H2a and H2bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between the PR of all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 6 The number in the table is a pvalue of any two algorithms of Nemenyi test From Tables 6and 4 we can see that the PR of MLP DBN and SAE aresignificantly greater than that of other trading algorithmsThe PR of LSTM is not significantly different from that ofGRU and NBThe PR of GRU is significantly lower than thatof all traditional ML algorithms The PR of NB is significantlylower than that of other traditional ML algorithms

(3) Through the hypothesis test analysis of H3a and H3bwe can obtain p valuelt22e-16 So there are statistically

significant differences between the RR of all trading algo-rithms Therefore we need to make multiple comparativeanalysis further as shown in Table 7 The number in thetable is a p value of any two algorithms of Nemenyi testFrom Tables 7 and 4 we can see that there is no significantdifference among the RR of all DNN models but the RRof any DNN model is significantly lower than that of alltraditional ML models The RR of NB is significantly lowerthan that of other traditional ML algorithms The RR ofCART is significantly lower than that of other traditional MLalgorithms except for NB

(4) Through the hypothesis test analysis of H4a and H4bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between the F1 of all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 8 The number in the table is a pvalue of any two algorithms of Nemenyi test From Tables8 and 4 we can see that there is no significant differenceamong the F1 of MLP DBN and SAE The F1 of MLP DBNand SAE are significantly greater than that of RNN LSTMGRU andNB but are significantly smaller than that of RF LRSVM and XGBThe F1 of GRU and LSTMhave no significantdifference but they are significantly smaller than that of alltraditional ML algorithms The F1 of XGB is significantlygreater than that of all other trading algorithms

Mathematical Problems in Engineering 9

Table 7Multiple comparison analysis between the RR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 10000 10000 10000LSTM 10000 10000 10000 10000GRU 09999 10000 09999 10000 10000CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00485 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 00555SVM 00000 00000 00000 00000 00000 00000 00197 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00010 09958 00000

Table 8Multiple comparison analysis between the F1 of any two trading algorithms The p value of the two trading strategies with significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 09998SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00810GRU 00000 00000 00000 00000 03489CART 00861 00061 00117 00000 00000 00000NB 00000 00000 00000 04635 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00078 00000LR 00000 00000 00000 00000 00000 00000 00173 00000 10000SVM 00007 00000 00000 00000 00000 00000 09797 00000 03336 04825XGB 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000

Table 9 Multiple comparison analysis between the AUC of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 10000 10000 10000LSTM 10000 10000 10000 09999GRU 10000 10000 10000 10000 09975CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00270 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 05428SVM 00000 00000 00000 00000 00000 00000 03125 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00002 03954 00000

(5) Through the hypothesis test analysis of H5a and H5bwe can obtain p valuelt22e-16 So there are statisticallysignificant differences between the AUC of all trading algo-rithms Therefore we need to make multiple comparativeanalysis further as shown in Table 9 The number in thetable is a p value of any two algorithms of Nemenyi testFrom Tables 9 and 4 we can see that there is no significantdifference among the AUC of all DNN models The AUC of

all DNN models are significantly smaller than that of anytraditional ML model

(6) Through the hypothesis test analysis of H6a and H6bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between theWRof all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 10 The number in the table is pvalue of any two algorithms of Nemenyi test From Tables 4

10 Mathematical Problems in Engineering

Table10M

ultip

lecomparis

onanalysisbetweentheW

Rof

anytwotradingalgorithm

sTh

epvalueo

fthe

twotradingstr

ategiesw

ithsig

nificantd

ifference

isin

boldface

Index

BAH

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

BAH

000

00MLP

000

00000

00DBN

000

00000

0010

000

SAE

000

00000

0010

000

1000

0RN

N000

00000

00000

00000

00000

00LSTM

000

00000

00000

00000

00000

0009974

GRU

000

11000

00000

01000

00000

0010

000

09961

CART

000

0009998

000

00000

00000

00000

00000

00000

00NB

000

00000

00000

00000

00000

00000

31000

00000

38000

00RF

000

00000

00000

00000

00000

0000118

000

0100140

000

0010

000

LR000

00000

00000

00000

00000

0010

000

08508

1000

0000

00004

320117

7SV

M000

00000

00000

00000

00000

0010

000

1000

010

000

000

00000

01000

0609780

XGB

000

00000

00000

00000

00000

0002660

000

8402927

000

0009831

09989

07627

00376

Mathematical Problems in Engineering 11

Table 11Multiple comparison analysis between theARRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00001 00006 00001LSTM 00000 00000 00000 00002 00000 10000GRU 00000 00000 00001 00008 00001 10000 10000CART 00000 00000 10000 10000 10000 00001 00000 00001NB 00000 00000 00021 00094 00022 10000 09998 10000 00018RF 00000 00000 07978 09524 08036 01685 00874 01962 07745 05861LR 00000 00000 00002 00012 00002 10000 10000 10000 00002 10000 02408SVM 00000 00000 02375 04806 02427 07029 05214 07457 02178 09778 09999 08015XGB 00000 00000 00674 01856 00694 09423 08466 09576 00600 09996 09905 09739 10000

Table 12Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 09667MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 08763 07617 08998LSTM 00000 00000 09922 09701 09949 10000GRU 00000 00000 06124 04563 06537 10000 09996CART 00000 00000 00002 00005 00002 00000 00000 00000NB 00000 00000 00467 00233 00557 09529 07037 09971 00000RF 00000 00000 00000 00000 00000 00291 00042 01062 00000 08010LR 00000 00000 07506 06025 07859 10000 10000 10000 00000 09872 00602SVM 00000 00000 01759 01020 02010 09982 09399 10000 00000 10000 04671 09998XGB 00000 00000 00099 00044 00122 07548 03776 09470 00000 10000 09681 08791 09997

and 10 we can see that the WR of MLP DBN and SAE haveno significant difference but they are significantly higherthan that of BAH and benchmark index and significantlylower than that of other trading algorithms TheWR of RNNLSTM and GRU have no significant difference but they aresignificantly higher than that of CART and significantly lowerthan that of NB and RF The WR of LR is not significantlydifferent from that of RF SVM and XGB

(7) Through the analysis of the hypothesis test of H7aand H7b we obtain p valuelt22e-16 Therefore there aresignificant differences between the ARR of all trading strate-gies including the benchmark index and BAH We needto do further multiple comparative analysis as shown inTable 11 From Tables 4 and 11 we can see that the ARR ofthe benchmark index and BAH are significantly lower thanthat of all ML algorithms The ARR of MLP DBN and SAEare significantly greater than that of RNN LSTM GRU NBand LR but not significantly different from that of CARTRF SVM and XGB there is no significant difference betweenthe ARR of MLP DBN and SAE The ARR of RNN LSTM

and GRU are significantly less than that of CART but theyare not significantly different from that of other traditionalML algorithms In all traditional ML algorithms the ARR ofCART is significantly greater than that of NB and LR butotherwise there is no significant difference between ARR ofany other two algorithms

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore there are significantdifferences between ASR of all trading strategies includingthe benchmark index and BAH The results of our multiplecomparative analysis are shown in Table 12 From Tables 4and 12 we can see that the ASR of the benchmark index andBAH are significantly smaller than that of all ML algorithmsThe ASR of MLP and DBN are significantly greater than thatof CART and are significantly smaller than that of NB RFand XGB but there is no significant difference between MLPDBN and other algorithms The ASR of SAE is significantlygreater than that of CART and significantly less than that ofRF and XGB but there is no significant difference betweenSAE and other algorithms The ASR of RNN and LSTM

12 Mathematical Problems in Engineering

Table 13 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00052DBN 00000 00031 10000SAE 00000 00012 10000 10000RNN 00000 00000 01645 02243 03556LSTM 00000 00000 06236 07173 08511 10000GRU 00000 00000 00245 00381 00760 10000 09860CART 00000 00000 01496 02057 03309 10000 10000 10000NB 00000 00000 00786 01136 01999 10000 09994 10000 10000RF 00000 00000 00002 00004 00012 08964 04248 09980 09109 09713LR 00000 00000 05451 06428 07935 10000 10000 09933 10000 09998 05015SVM 00000 00000 02433 03194 04734 10000 10000 09999 10000 10000 08155 10000XGB 00000 00000 00103 00167 00360 09998 09462 10000 09999 10000 09998 09685 09989

Table 14 Trading performance of different trading strategies in CSICS Best performance of all trading strategies is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGBAR mdash mdash 05175 05167 05163 05030 04993 04993 05052 05084 05090 05084 05112 05087PR mdash mdash 07548 07436 07439 05414 04964 04956 05022 05109 05128 04967 05695 05026RR mdash mdash 05252 05250 05248 05234 05224 05223 05279 05307 05311 05318 05295 05315F1 mdash mdash 06150 06108 06108 05320 05086 05082 05143 05192 05214 05132 05483 05164AUC mdash mdash 05027 05024 05020 05006 04995 04996 05049 05078 05082 05086 05074 05085WR 05222 05090 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803ARR 00633 02224 05731 05704 05678 05248 05165 05113 05534 06125 04842 05095 05004 04938ASR 02625 04612 14031 14006 13935 14880 15422 15505 12232 11122 14379 15582 14231 14698MDD 04808 06697 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632

are significantly greater than that of CART and significantlyless than that of RF but there is no significant differencebetweenRNN LSTM and other algorithmsTheASRofGRUis significantly greater than that of CART but there is nosignificant difference between GRU and other traditional MLalgorithms In all traditional ML algorithms the ASR of allalgorithms are significantly greater than that of CART butotherwise there is no significant difference between ASR ofany other two algorithms

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between MDD of trading strategies includingthe benchmark index and the BAH The results of multiplecomparative analysis are shown in Table 13 From Tables4 and 13 we can see that MDD of any ML algorithm issignificantly greater than that of the benchmark index butsignificantly smaller than that of BAH strategy The MDDof MLP and DBN are significantly smaller than those ofGRU RF and XGB but there is no significant differencebetween MLP DBN and other algorithms The MDD ofSAE is significantly smaller than that of XGB but there isno significant difference between SAE and other algorithmsOtherwise there is no significant difference betweenMDDofany other two algorithms

In a word the traditional ML algorithms such as NBRF and XGB have good performance in most directional

evaluation indicators such as AR PR and F1 The DNNalgorithms such as MLP have good performance in PR andARR In traditional ML algorithms the ARR of CART RFSVM and XGB are not significantly different from that ofMLP DBN and SAE the ARR of CART is significantlygreater than that of LSTM GRU and RNN but otherwisethe ARR of all traditional ML algorithms are not significantlyworse than that of LSTM GRU and RNN The ASR of alltraditional ML algorithms except CART are not significantlyworse than that of the six DNNmodels even the ASR of NBRF and XGB are significantly greater than that of some DNNalgorithms The MDD of RF and XGB are significantly lessthat of MLP DBN and SAE the MDD of all traditional MLalgorithms are not significantly different from that of LSTMGRU and RNNThe ARR and ASR of all ML algorithms aresignificantly greater than that of BAH and the benchmarkindex the MDD of any ML algorithm is significantly greaterthan that of the benchmark index but significantly less thanthat of BAH strategy

53 Comparative Analysis of Performance of Different TradingStrategies in CSICS The analysis methods of this part aresimilar to Section 52 From Table 14 we can see that the ARPR and F1 of MLP are the greatest in all trading algorithmsThe RR AUC WR and ASR of LR are the greatest inall trading algorithms respectively The ARR of NB is the

Mathematical Problems in Engineering 13

Table 15Multiple comparison analysis between theARof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 01857GRU 00000 00000 00000 04439 10000CART 00000 00000 00000 09765 00024 00131NB 00000 00001 00002 00022 00000 00000 01810RF 00000 00002 00005 00007 00000 00000 00941 10000LR 00000 00000 00000 00076 00000 00000 03454 10000 10000SVM 00217 00766 01309 00000 00000 00000 00003 08314 09352 06360XGB 00000 00001 00001 00025 00000 00000 01930 10000 10000 10000 08168

Table 16Multiple comparison analysis between the PRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 09906 09781NB 00000 00000 00000 00000 01716 01234 08940RF 00000 00000 00000 00000 00319 00205 05271 10000LR 00000 00000 00000 00000 10000 10000 09951 02099 00422SVM 00000 00000 00000 01157 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00000 09922 09811 10000 08836 05086 09960 00000

highest in all trading strategies The MDD of CSI 300 index(benchmark index) is the smallest in all trading strategiesTheWRARR and ASR of all ML algorithms are greater thanthose of the benchmark index and BAH strategy

(1) Through the hypothesis test analysis of H1a and H1bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the AR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 15The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 15 we can see that the AR ofMLPDBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms except for SVM The ARof GRU is significantly smaller than that of all traditional MLalgorithms There is no significant difference between the ARof any two traditional ML algorithms except for CART andSVM

(2) Through the hypothesis test analysis of H2a and H2bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the PR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 16 The number in the tableis a p value of any two algorithms of Nemenyi test FromTables 14 and 16 we can see that the PR of MLP DBN and

SAE are significantly greater than that of all other tradingalgorithms and the PR of MLP DBN and SAE have nosignificant difference The PR of SVM is significantly greaterthan that of all other traditional ML algorithms which haveno significant difference between any two algorithms exceptfor SVM The PR of RNN is significantly greater than thatof all traditional ML algorithms except for SVM The PR ofGRU and LSTM are not significantly different from that of alltraditional ML algorithms except for SVM and LR

(3) Through the hypothesis test analysis of H3a and H3bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the RR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 17 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 17 we can see that the RR of all DNN models arenot significantly different There is no significant differenceamong the RR of all traditional ML algorithms The RR ofRNN GRU and LSTM are significantly smaller than that ofany traditional ML algorithm except for CART

(4) Through the hypothesis test analysis of H4a and H4bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the F1 of all trading algorithms There-fore we need to do further multiple comparative analysis and

14 Mathematical Problems in Engineering

Table 17Multiple comparison analysis between the RRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 09996 09996 10000LSTM 09309 09314 09781 09999GRU 09660 09663 09916 10000 10000CART 09744 09742 09225 05809 01509 02138NB 01093 01088 00574 00075 00004 00007 08861RF 00537 00534 00260 00028 00001 00002 07544 10000LR 00330 00328 00152 00015 00001 00001 06498 10000 10000SVM 03444 03434 02170 00434 00033 00059 09920 10000 09998 09991XGB 00193 00192 00085 00007 00000 00000 05344 10000 10000 10000 09960

Table 18 Multiple comparison analysis between the F1 of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 07211 06670NB 00000 00000 00000 00136 00132 00099 08664RF 00000 00000 00000 00786 00016 00011 05162 10000LR 00000 00000 00000 00000 09440 09208 10000 05675 02181SVM 00000 00000 00000 00178 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00001 03138 02679 10000 09937 08849 09964 00000

Table 19 Multiple comparison analysis between the AUC of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 09999 10000RNN 09945 09985 10000LSTM 05273 06382 09259 09937GRU 08448 09102 09958 10000 10000CART 06921 05835 02356 00801 00014 00096NB 00002 00001 00000 00000 00000 00000 02616RF 00001 00001 00000 00000 00000 00000 02002 10000LR 00000 00000 00000 00000 00000 00000 00930 10000 10000SVM 00027 00014 00001 00000 00000 00000 06454 10000 09999 09980XGB 00000 00000 00000 00000 00000 00000 01257 10000 10000 10000 09993

the results are shown in Table 18The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 18 we can see that the F1 of MLP DBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms There is no significantdifference among traditionalML algorithms except SVM andthe F1 of SVM is significantly greater than that of all othertraditional ML algorithms

(5) Through the hypothesis test analysis of H5a and H5bwe can obtain p valuelt22e-16Therefore there are significantdifferences between theAUCof all trading algorithmsThere-fore we need to do further multiple comparative analysis andthe results are shown in Table 19 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 19 we can see that the AUC of all DNN models haveno significant difference There is no significant difference

Mathematical Problems in Engineering 15

Table 20 Multiple comparison analysis between the WR of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 04117MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00002 00006 00000LSTM 00000 00000 00000 00000 00000 09772GRU 00000 00000 00000 00000 00000 09911 10000CART 09931 00000 00000 00000 00000 00000 00000 00000NB 00031 00000 00001 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00205 06437 05358 00000 00000LR 00000 00000 00000 00000 00000 00010 01611 01105 00000 00000 10000SVM 00000 00000 00000 00000 00000 09914 10000 10000 00000 00000 05322 01090XGB 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000

Table 21Multiple comparison analysis between theARRof any two trading strategiesThepvalue of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00007MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 04790 06355 07182LSTM 00000 00000 02512 03806 04630 10000GRU 00000 00000 02235 03454 04249 10000 10000CART 00000 00000 08301 09217 09542 10000 09999 09998NB 00000 00000 10000 10000 10000 02920 01295 01125 06517RF 00000 00000 00020 00048 00076 08705 09735 09806 05393 00006LR 00000 00000 02058 03222 03995 10000 10000 10000 09996 01019 09845SVM 00000 00000 10000 00803 01114 09993 10000 10000 09659 00165 09999 10000XGB 00000 00000 10000 00333 00484 09916 09997 09998 08789 00057 10000 09999 10000

between the AUC of all traditional ML algorithms TheAUC of all traditional ML algorithms except for CART aresignificantly greater than that of any DNN model There isno significant difference among the AUC ofMLP SAE DBNRNN and CART

(6)Through the hypothesis test analysis of H6a and H6bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the WR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 20 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 20 we can see that the WR of BAH and benchmarkindex have no significant difference but they are significantlysmaller than that of anyML algorithmTheWRofMLPDBNand SAE are significantly smaller than that of the other trad-ing algorithms but there is no significant difference betweenthe WR of MLP DBN and SAE The WR of LSTM andGRU have no significant difference but they are significantlysmaller than that of XGB and significantly greater than that of

CART and NB In traditional MLmodels the WR of NB andCART are significantly smaller than that of other algorithmsThe WR of XGB is significantly greater than that of all otherML algorithms

(7)Through the analysis of the hypothesis test of H7a andH7b we obtain p valuelt22e-16

Therefore there are significant differences between theARR of all trading strategies including the benchmark indexand BAH strategy Therefore we need to do further multiplecomparative analysis and the results are shown in Table 21FromTables 14 and 21 we can see that ARR of the benchmarkindex and BAH are significantly smaller than that of alltrading algorithms The ARR of MLP is significantly higherthan that of RF but there is no significant difference betweenMLP and other algorithms The ARR of SAE and DBN aresignificantly higher than that of RF and XGB but they arenot significantly different fromARR of other algorithms TheARR of NB is significantly higher than that of RF SVMand XGB But otherwise there is no significant difference

16 Mathematical Problems in Engineering

Table 22Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 08877MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 09099 08862 08114LSTM 00000 00000 03460 03080 02239 09999GRU 00000 00000 02132 01853 01270 09981 10000CART 00000 00000 00158 00195 00327 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000 00000 07298RF 00000 00000 10000 10000 10000 09968 07444 05789 00018 00000LR 00000 00000 01181 01003 00650 09879 10000 10000 00000 00000 04044SVM 00000 00000 10000 10000 10000 09849 05952 04238 00042 00000 10000 02704XGB 00000 00000 09937 09902 09746 10000 09878 09532 00001 00000 10000 08723 09998

Table 23 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00006DBN 00000 00004 10000SAE 00000 00023 10000 10000RNN 00000 00000 00320 00421 00111LSTM 00000 00000 00002 00003 00000 09947GRU 00000 00000 00001 00001 00000 09767 10000CART 00000 00000 01238 01538 00521 10000 09241 08305NB 00000 01875 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 01180 01469 00493 10000 09298 08401 10000 00000LR 00000 00000 00001 00002 00000 09881 10000 10000 08821 00000 08898SVM 00000 00000 03285 03839 01701 09999 07011 05424 10000 00000 10000 06216XGB 00000 00000 00308 00405 00106 10000 09951 09783 10000 00000 10000 09890 09998

between any other two algorithms Therefore the ARR ofmost traditional ML models are not significantly worse thanthat of the best DNNmodel

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore There are significantdifferences betweenASRof all trading strategies including thebenchmark index and BAH strategy The results of multiplecomparative analysis are shown in Table 22 From Tables 14and 22 we can see that the ASR of the benchmark indexand BAH are significantly smaller than that of all tradingalgorithms The ASR of all ML algorithms are significantlyhigher than that of CART and NB but there is no significantdifference between the ASR of CART and NB Beyond thatthere is no significant difference between any other twoalgorithms Therefore the ASR of all traditional ML modelsexcept NB and CART are not significantly worse than that ofany DNNmodel

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between the MDD of these trading strategies

including the benchmark index and the BAH strategyThe results of multiple comparative analysis are shown inTable 23 From Tables 14 and 23 we can see that the MDDof the benchmark index is significantly smaller than that ofother trading strategies including BAH strategy TheMDD ofBAH is significantly greater than that of all trading algorithmsexcept NBTheMDDofMLPDBN and SAE are significantlylower than that of NB but significantly higher than thatof RNN LSTM GRU LR and XGB The MDD of NB issignificantly greater than that of all other trading algorithmsBeyond that there is no significant difference between anyother two algorithms Therefore all ML algorithms expectNB especially LSTM RNN GRU LR and XGB can play arole in controlling trading risk

In a word some DNN models such as MLP DBN andSAE have good performance in AR PR and F1 traditionalML algorithms such as LR and XGB have good performanceinAUCandWRTheARRof some traditionalML algorithmssuch as CART NB LR and SVM are not significantlydifferent from that of the six DNN models The ASR of the

Mathematical Problems in Engineering 17

six DNN algorithms are not significantly different from alltraditional ML models except NB and CART The MDD ofLR and XGB are significantly smaller than those of MLPDBN and SAE and are not significantly different fromthat of LSTM GRU and RNN The ARR and ASR of allML algorithms are significantly greater than those of BAHand benchmark index the MDD of all ML algorithms aresignificantly smaller than that of the benchmark index butsignificantly greater than that of BAH strategy

From the above analysis and evaluation we can see thatthe directional evaluation indicators of some DNN modelsare very competitive in CSICS while the indicators of sometraditional ML algorithms have excellent performance inSPICS Whether in SPICS or CSICS the ARR and ASR ofall ML algorithms are significantly greater than that of thebenchmark index and BAH strategy respectively In all MLalgorithms there are always some traditional ML algorithmswhich are not significantly worse than the best DNN modelfor any performance evaluation indicator (ARR ASR andMDD)Therefore if we do not consider transaction cost andother factors affecting trading performance of DNN modelsare alternative but not the best choice when they are appliedto stock trading

In the same period the ARR of any ML algorithm inCSICS is significantly greater than that of the same algorithmin SPICS (p valuelt0001 in theNemenyi test)Meanwhile theMDD of any ML algorithm in CSICS is significantly greaterthan that of the same algorithm in SPICS (p value lt0001in the Nemenyi test) The results show that the quantitativetrading algorithms can more easily obtain excess returns inthe Chinese A-share market but the volatility risk of tradingin Chinese A-share market is significantly higher than that ofthe US stock market in the past 8 years

6 The Impact of Transaction Cost onPerformance of ML Algorithms

Trading cost can affect the profitability of a stock tradingstrategy Transaction cost that can be ignored in long-termstrategies is significantly magnified in daily trading Howevermany algorithmic trading studies assume that transactioncost does not exist ([10 17] etc) In practice frictions suchas transaction cost can distort the market from the perfectmodel in textbooks The cost known prior to trading activityis referred to as transparent such as commissions exchangefees and taxes The costs that has to be estimated are knownas implicit including comprise bid-ask spread latency orslippage and related market impact This section focuses onthe transparent and implicit cost and how do they affecttrading performance in daily trading

61 Experimental Settings and Backtesting Algorithm In thispart the transparent transaction cost is calculated by a certainpercentage of transaction turnover for convenience theimplicit transaction cost is very complicated in calculationand it is necessary to make a reasonable estimate for therandom changes of market environment and stock pricesTherefore we only discuss the impact of slippage on tradingperformance

The transaction cost structures of American stocks aresimilar to that of Chinese A-shares We assume that transpar-ent transaction cost is calculated by a percentage of turnoversuch as less than 05 [40 41] and 02 and 05 in theliterature [42] It is different for the estimation of slippage

In some quantitative trading simulation software such asJoinQuant [43] and Abuquant [44] the slippage is set to 002The transparent transaction cost and implicit transaction costare charged in both directions when buying and selling Itis worth noting that the transparent transaction cost varieswith the different brokers while the implicit transaction costis related to market liquidity market information networkstatus trading software etc

We set slippages s = s0=0 s1=001 s2=002 s3=003s4=004 the transparent transaction cost c = c0=0 c1=0001c2=0002 c3=0003 c4=0004 c5=0005 For different s ccombinations we study the impact of different transactioncost structures on trading performance We assume thatbuying and selling positions are one unit so the turnover isthe corresponding stock price When buying stocks we notonly need to pay a certain percentage cost of the purchaseprice but also need to pay an uncertain slippage cost Thatis we need to pay a higher price than the real-time price119875119905minus1

when we are buying But when selling stocks we notonly need to pay a certain percentage cost of the sellingprice but also to pay an uncertain slippage cost Generallyspeaking we need to sell at a price lower than the real-timeprice 119875

119905 It is worth noting that our trading strategy is self-

financing If ML algorithms predict the continuous occur-rence of buying signals or selling signals ie |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 0 we will continue to hold or do nothingso the transaction cost at this time is 0 when |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 1 it is indicated that the position maybe changed from holding to selling or from empty positionto buying At this time we would pay transaction costdue to the trading operation Finally we get a real yieldis

119877119890119905119905le119862119897119900119904119890119875119903119894119888119890

119905minus 119862119897119900119904119890119875119903119894119888119890

119905minus1

119862119897119900119904119890119875119903119894119888119890119905minus1

119875119905= 119862119897119900119904119890119875119903119894119888119890

119905

lowast (1 minus 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816)

minus 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816

119875119905minus1

= 119862119897119900119904119890119875119903119894119888119890119905minus1

lowast (1 + 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816)

+ 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816

119877119890119905119905=119875119905minus 119875119905minus1

119875119905minus1

(5)

where 119862119897119900119904119890119875119903119894119888119890119905

denotes the 119905-th closing price119879119903119886119889119890119878119894119892119899119886119897

119905denotes the 119905-th trading signal 119875

119905denotes

the 119905-th executing price and 119877119890119905119905denotes the 119905-th return rate

We propose a backtesting algorithm with transaction costbased on the above analysis as is shown in Algorithm 3

18 Mathematical Problems in Engineering

Input TS TS is trading signals of a stocks s is slippagec c is transparent transaction cost

Output WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) WR=NULL ARR=NULL ASR=NULL MDD=NULL(3) for (i in 1 N) (4) Stock Data=Stock Code List[i](5) ClosePricet=Stock Data [ldquoClosing Pricerdquo](6) Pt =ClosePricet lowast(1-clowastabs(TSt-TSt-1)) - slowastabs(TSt-TSt-1)(7) Pt-1 =ClosePricetlowast(1+clowastabs(TSt-TSt-1)) + slowastabs(TSt-TSt-1)(8) Rett= (Pt- Pt-1) Pt Ret is the return rate series(9) TDRR=lag (TS)lowastRet TDRR is the daily return through trading(10) WR[i]=sum (TDRRgt0)sum(TDRR =0)(11) ARR[i]=Returnannualized (TDRR)(12) ASR[i]=SharpeRatioannualized (TDRR)(13) MDD[i]=maxDrawDown (TDRR)(14) WR=c (WR WR[i])(15) ARR=c (ARR ARR[i])(16) ASR=c (ASR ASR[i])(17) MDD=c (MDD MDD[i])(18) (19) return (WR ARR ASR MDD)

Algorithm 3 Backtesting algorithm with transaction cost in R language

62 Analysis of Impact of Transaction Cost on the TradingPerformance of SPICS Transaction cost is one of the mostimportant factors affecting trading performance In US stocktrading transparent transaction cost can be charged accord-ing to a fixed fee per order or month or a floating fee basedon the volume and turnover of each transaction Sometimescustomers can also negotiate with broker to determinetransaction cost The transaction cost charged by differentbrokers varies greatly Meanwhile implicit transaction costis not known beforehand and the estimations of them arevery complex Therefore we assume that the percentageof turnover is the transparent transaction cost for ease ofcalculation In the aspect of implicit transaction cost we onlyconsider the impact of slippage on trading performance

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 24 WR is decreasing with the increase oftransaction cost for any trading algorithm which is intuitiveWhen the transaction cost is set to (s c) = (004 0005) theWR of each algorithm is the lowest Compared with setting(s c) = (0 0) the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR and SVM to XGB are reduced by580 597 591 1583 1804 1395 2171 16042216 1854 1850 and 2597 respectively ThereforeMLP DBN and SAE are more tolerant to transaction costGenerally speaking the DNN models have stronger capacityto accommodate transaction cost than the traditional MLmodels From the single trading algorithm such as MLP ifwe do not consider slippage ie s=0 the average WR ofMLP is 05510 under transaction cost structures (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not considertransparent transaction cost ie c=0 the averageWRofMLP

is 05618 under transaction cost structures (s1 c0) (s2 c0)(s3 c0) (s4 c0) so transparent transaction cost has greaterimpact than slippageThroughmultiple comparative analysisthe WR under the transaction cost structure (s1 c0) is notsignificantly different from the WR without transaction costfor MLP DBN and SAETheWR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the WR under the transaction cost structure (s1 c0) (s2 c0) are not significantly different from theWRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 25 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the lowest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 4031 4157 and 4093 respectivelywhile the ARR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin accounts For a general setting of s and c ie (s c) = (0020003) ARR of MLP DBN and SAE decrease by 23262400 and 2361 respectively while the ARR of otheralgorithms decrease by more than 50 and that of CARTand XGB decrease bymore than 100ThereforeMLP DBNand SAE are more tolerant to high transaction cost Fromsingle trading algorithm such as RNN if we do not considerslippage ie s=0 the average ARR of RNN is 01434 under

Mathematical Problems in Engineering 19

Table24Th

eWRof

SPICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

05676

05680

05683

05843

05825

05844

05266

05930

05912

05859

05831

05891

(s0c1)

05615

05618

05621

05669

05626

05694

05052

05752

05663

05654

05630

05599

(s0c2)

05560

05560

05564

05507

05442

05553

04847

05585

05429

05463

05438

05324

(s0c3)

05507

05506

05510

05353

05269

05418

04652

05424

05205

05278

05253

05061

(s0c4)

05457

05454

05460

05206

05101

05289

044

7005277

04996

05105

05084

04818

(s0c5)

05410

05407

05412

05071

04946

05170

04303

05138

04803

04947

04924

04594

(s1c0)

056

49056

53056

5605778

05751

05785

05190

058

61058

2405782

05759

05788

(s1c1)

05594

05597

05600

05619

05571

05648

04991

05700

05597

05595

05574

05521

(s1c2)

05539

05539

05544

05458

05389

05508

04788

05534

05364

05406

05383

05249

(s1c3)

05487

05486

05491

05305

05215

05375

04597

05375

05141

05223

05200

04988

(s1c4)

05438

05436

05441

05163

05052

05249

044

1805231

04938

05054

05034

04750

(s1c5)

05394

05390

05396

05032

04902

05132

04255

05097

04751

04900

04880

04532

(s2c0)

05628

05631

05635

05729

056

9705741

05134

058

1105758

05726

05704

05713

(s2c1)

05573

05574

05578

05568

05515

05602

04931

05647

05527

05535

05515

05442

(s2c2)

05518

05518

05523

05408

05336

05463

04729

05482

05297

05349

05326

05172

(s2c3)

05469

05467

05472

05260

05164

05334

04543

05330

05082

05171

05150

04918

(s2c4)

05421

05417

05423

05120

05004

05209

04368

05187

04881

05004

04986

046

85(s2c5)

05377

05373

05379

04993

04858

05096

04209

05055

04699

04855

04835

044

73(s3c0)

05606

05609

05612

05678

05640

05694

05074

05759

05690

05668

05646

05635

(s3c1)

05552

05553

05558

05518

05460

05556

04872

05595

05460

05478

05459

05365

(s3c2)

05499

05498

05503

05362

05284

05422

046

7505434

05233

05295

05273

05099

(s3c3)

05450

05448

05453

05216

05114

05292

04491

05284

05020

05120

05098

04849

(s3c4)

05405

05401

05407

05080

04960

05172

04321

05146

04827

04959

04940

04622

(s3c5)

05362

05357

05363

04955

04816

05063

04166

05017

04651

04815

04793

044

17(s4c0)

05587

05589

05593

05630

05588

05652

05019

05710

05627

05613

05593

05562

(s4c1)

05533

05533

05537

05470

05407

05513

04815

05544

05395

05424

05404

05290

(s4c2)

05480

05479

05484

05316

05232

05380

04620

05386

05171

05242

05220

05026

(s4c3)

05432

05429

05435

05172

05067

05253

044

4005241

04964

05070

05051

04782

(s4c4)

05388

05384

05391

05041

04917

05137

04274

05106

04775

04914

04897

04564

(s4c5)

05347

05341

05347

04918

04774

05029

04123

04979

046

0204773

04752

04361

20 Mathematical Problems in Engineering

Table25Th

eARR

ofSP

ICSford

ailytradingwith

different

transactioncost

Ther

esultthatthere

isno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

03332

03296

03325

02943

02920

02934

03317

02975

03133

02942

03067

03041

(s0c1)

03128

030

8703118

02439

02327

02521

02266

02496

02384

02336

02400

02137

(s0c2)

02924

02879

02912

01936

01735

02108

01216

02017

01636

01731

01734

01234

(s0c3)

02721

02672

02706

01433

0114

301697

00168

01539

00889

01126

01070

00333

(s0c4)

02519

02464

02500

00931

00553

01285

-00878

01062

00143

00522

004

06-00567

(s0c5)

02316

02257

02294

00430

-00037

00875

-019

2400586

-00602

-0008

-00257

-014

66(s1c0)

03249

03212

03242

027

7802729

02794

029

53028

18028

9802747

028

5502762

(s1c1)

03046

03004

03035

02274

02136

02381

01902

02339

02149

02141

02188

01859

(s1c2)

02842

02796

02829

01771

01544

01969

00853

01861

01401

01536

01523

00957

(s1c3)

02639

02588

02623

01269

00953

01557

-00195

01383

00654

00931

00858

000

56(s1c4)

02437

02381

02417

00767

00363

0114

6-012

41009

06-00091

00328

00195

-00844

(s1c5)

02234

02174

02211

00266

-00226

00735

-02285

00430

-00836

-00275

-0046

8-01742

(s2c0)

03167

03129

03159

026

1302538

026

54025

89026

61026

6302551

026

43024

84(s2c1)

02964

02921

02952

02110

01946

02241

01539

02182

01914

01946

01977

01581

(s2c2)

0276

02713

02746

01607

01354

01829

00490

01704

0116

701341

01312

006

79(s2c3)

02557

02505

02540

0110

400763

01418

-00557

01227

004

2000737

006

47-00221

(s2c4)

02355

02298

02334

006

0300173

01007

-016

0300750

-00325

00134

-00016

-01120

(s2c5)

02153

02091

02129

00102

-00416

00597

-0264

700274

-010

69-00469

-00678

-02018

(s3c0)

030

85030

46030

7602448

02348

02514

02225

02504

02428

02356

02431

02206

(s3c1)

02881

02838

02869

01945

01756

02102

0117

502026

01680

01751

01765

01304

(s3c2)

02678

02630

02663

01442

01164

01690

00127

01548

00933

0114

601100

004

02(s3c3)

02476

02422

02457

00940

00574

01279

-00919

01071

00187

00543

00436

-00498

(s3c4)

02273

02215

02252

00439

-00016

00868

-019

6400595

-00558

-0006

-00227

-013

97(s3c5)

02071

02008

02047

-00062

-0060

5004

58-0300

800119

-013

02-00662

-00889

-02294

(s4c0)

03003

02962

02993

02284

02157

02374

01862

02348

02193

02161

02219

01929

(s4c1)

02799

02754

02786

01781

01565

01962

00813

01870

01445

01556

01554

01026

(s4c2)

02597

02547

02580

01278

00974

01551

-00235

01392

00699

00952

00889

00125

(s4c3)

02394

02339

02375

00776

00384

0114

0-012

8100915

-0004

700349

00226

-00774

(s4c4)

02192

02132

02169

00275

-00205

00729

-02326

00439

-00792

-00254

-00437

-016

73(s4c5)

01989

01926

01964

-00225

-00794

00319

-033

69-00037

-015

35-00856

-010

99-02570

Mathematical Problems in Engineering 21

the transaction cost structures (s0 c1) (s0 c2) (s0 c3) (s0c4) (s0 c5) if we do not consider transparent transactioncost ie c=0 the average ARR of RNN is 02531 under thetransaction cost structure (s1 c0) (s2 c0) (s3 c0) (s4c0) so transparent transaction cost has greater impact thanslippage Through multiple comparative analysis the ARRunder the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s0 c1) are not significantly different from the ARRwithout transaction cost for MLP DBN and SAE the ARRunder all other transaction cost structures are significantlysmaller than theARRwithout transaction cost For all tradingalgorithms except for MLP DBN and SAE the ARR underthe transaction cost structures (s1 c0) (s2 c0) are notsignificantly different from the ARR without transactioncost the ARR under all other transaction cost structures aresignificantly smaller than the ARR without transaction cost

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 26 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theASR of each algorithm is the lowest Compared with settingwithout transaction cost the ASR of MLP DBN and SAEreduce by 3997 4123 and 4066 respectively while theASR of other trading algorithms reduce by more than 90compared with the case of no transaction cost Thereforeexcessive transaction cost will significantly reduce ASR Fora general setting of s and c ie (s c) = (002 0003) theASR of MLP DBN and SAE decrease by 2262 2336and 2302 respectively while the ASR of other algorithmsdecrease by more than 50 the ASR of CART and XGBdecrease by more than 100Therefore MLP DBN and SAEare more tolerant to transaction cost From single tradingalgorithm such as NB if we do not consider slippage ies=0 the average ASR of NB is 08052 under the transactioncost structure (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5)if we do not consider transparent transaction cost ie c=0the average ASR of NB is 14182 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has greater impact than slippage Throughmultiple comparative analysis the ASR under the transactioncost structures (s1 c0) (s2 c0) (s3 c0) (s0 c1) are notsignificantly different from the ASR without transaction costfor MLP DBN and SAE the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the ASR under the transaction cost structures(s1 c0) (s2 c0) are not significantly different from the ASRwithout transaction cost the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 27 MDD increases with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the settings without transaction cost theMDD of MLP DBN and SAE increase by 932 1108 and

1032 respectively The MDD of other trading algorithmsincrease by more than 80 compared with those withoutconsidering transaction costTherefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 483 580 and 533respectively while the MDD of other algorithms increase bymore than 35 and theMDDofCART RF andXGB increasebymore than 100Therefore MLP DBN and SAE are moretolerant to transaction cost As awhole theDNNmodels havestronger capacity to accommodate transaction cost than thetraditional ML models From single trading algorithm suchas GRU if we do not consider slippage ie s=0 the averageMDD of GRU is 04459 under the transaction cost structures(s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do notconsider transparent transaction cost ie c=0 the averageMDD of GRU is 03559 under the transaction cost structures(s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparent transactioncost has greater impact than slippage Through multiplecomparative analysis the MDD under any the transactioncost structure is not significantly different from the MDDwithout transaction cost for MLP DBN and SAE For alltrading algorithms except for MLP DBN and SAE such asLR the MDD under the transaction cost structures (s0 c1)(s1 c0) (s2 c0) (s3 c0) are not significantly different fromthe MDD without transaction cost the MDD under all othertransaction cost structures are significantly greater than theMDD without transaction cost

Through the analysis of the Table 27 performance eval-uation indicators we find that trading performance afterconsidering transaction cost will be worse than that withoutconsidering transaction cost as is in actual trading situationIt is noteworthy that the performance changes of DNNalgorithms especially MLP DBN and SAE are very smallafter considering transaction cost This shows that the threealgorithms have good tolerance to changes of transactioncost Especially for the MDD of the three algorithms thereis no significant difference with that with no transactioncost So we can consider applying them in actual tradingMeanwhile we conclude that the transparent transactioncost has greater impact on the trading performances thanthe slippage for SPICS This is because the prices of SPICSare too high when the transparent transaction cost is setto a certain percentage of turnover In actual transactionsspecial attention needs to be paid to the fact that the trans-action performance under most transaction cost structuresis significantly lower than the trading performance withoutconsidering transaction cost It is worth noting that theperformance of traditional ML algorithm is not worse thanthat ofDNNalgorithmswithout considering transaction costwhile the performance of DNN algorithms is better than thatof traditional ML algorithms after considering transactioncost

63 Analysis of Impact of Transaction Cost on the TradingPerformance of CSICS Similar to Section 62 we will discussthe impact of transaction cost on trading performance ofCSICS in the followings In the Chinese A-share marketthe transparent transaction cost is usually set to a certain

22 Mathematical Problems in Engineering

Table26Th

eASR

ofSP

ICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

1546

815

412

15502

15764

15571

15828

13927

16237

16763

15818

16018

16298

(s0c1)

1456

214

478

14577

1300

012

317

13565

09346

13554

12650

12472

12456

11294

(s0c2)

13639

13527

13635

10191

09015

11262

04657

10822

08482

09074

08846

06236

(s0c3)

12702

12561

12679

07355

05690

08929

-00085

08061

04298

05652

05216

0118

2(s0c4)

11751

11581

11709

04511

02366

06580

-04823

05291

00139

02234

01596

-03812

(s0c5)

1079

10591

10728

01678

-00931

04227

-09500

02534

-039

59-01152

-019

87-08696

(s1c0)

15121

1505

715

149

1492

714

606

15119

1244

915

424

1558

214

825

14974

1488

6(s1c1)

14208

14116

14217

12146

11334

12841

07823

12722

1144

711459

11394

09859

(s1c2)

13279

13159

13270

09325

08020

10526

03105

09977

07267

08048

07772

04792

(s1c3)

12337

12188

12308

064

8204690

08185

-016

4607209

03082

04622

04139

-00257

(s1c4)

11382

11204

11333

03637

01368

05831

-06374

04438

-010

6801208

00524

-052

31(s1c5)

10417

10210

10348

00807

-019

2003478

-110

2501686

-05146

-02169

-0304

7-10083

(s2c0)

1477

1469

914

792

1408

113

632

1440

310

946

1460

114

390

1382

213

922

1346

2(s2c1)

13851

13752

13854

11285

10343

12111

06283

11883

10237

10439

10325

08416

(s2c2)

12916

12789

12901

08454

07021

09785

01547

09128

060

4907019

06696

03346

(s2c3)

11969

11812

11934

05607

03688

07437

-032

0506355

01868

03591

03063

-016

90(s2c4)

11010

10825

10955

02763

00372

05081

-07916

03586

-02268

00183

-00545

-06639

(s2c5)

1004

109827

09967

-0006

-02905

02729

-12533

00841

-06323

-031

79-04101

-114

54(s3c0)

14415

14337

14432

13227

12650

13679

09425

13770

13189

12810

12862

12030

(s3c1)

13490

13384

13488

10419

09348

11375

04733

11039

09023

09413

09252

06971

(s3c2)

12551

12416

12529

07580

060

19090

40-00013

08275

04832

05988

05618

01904

(s3c3)

11599

11435

11558

04731

02688

066

88-04757

05500

00658

02562

01988

-031

16(s3c4)

10636

10443

10575

01891

-00620

04331

-0944

202735

-0346

0-00836

-016

08-08034

(s3c5)

09664

09443

09584

-00924

-03883

01982

-14018

000

00-074

89-04183

-05146

-12808

(s4c0)

14058

13972

1406

812

368

11662

12950

07892

12933

11983

11793

11796

10591

(s4c1)

13127

13013

13119

09549

08350

10634

03180

10190

07807

08386

08177

05527

(s4c2)

12183

1204

12155

06705

05018

08293

-015

6807421

03617

04958

04542

004

68(s4c3)

11226

11055

11179

03857

01691

05938

-06295

046

47-00545

01537

00918

-04529

(s4c4)

1026

1006

10193

01021

-016

0703582

-10948

01888

-0464

2-018

49-02665

-09413

(s4c5)

09286

09057

09199

-017

83-04853

01238

-15478

-00836

-0864

2-05177

-06182

-14142

Mathematical Problems in Engineering 23

Table 27 The MDD of SPICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 03583 03584 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338(s0 c1) 03629 03638 03594 03779 03986 03636 04072 03712 03843 03963 03972 04203(s0 c2) 03677 03695 03647 04302 04707 03968 05168 04127 04842 04729 04787 05735(s0 c3) 03727 03756 03703 04990 05639 04376 06564 04709 06172 05682 05844 07335(s0 c4) 03781 03821 03764 05767 06612 04873 07804 05424 07377 06653 06913 08447(s0 c5) 03839 03890 03828 06529 0746 05444 08730 06162 08272 07501 07808 09118(s1 c0) 03596 03600 03560 03500 036130 03446 03574 03502 03414 03585 03569 03540(s1 c1) 03642 03655 03609 03907 04156 03717 04320 03814 04067 04154 04170 04541(s1 c2) 03691 03712 03662 04466 04936 04066 05534 04270 05172 04971 05049 06168(s1 c3) 03742 03774 03720 05183 05895 04495 06928 04885 06499 05937 06129 07662(s1 c4) 03796 03839 03781 05961 06842 05013 08105 05610 07631 06884 07161 08649(s1 c5) 03856 03909 03847 0671 07646 05595 08946 06342 08451 07691 0800 09235(s2 c0) 03609 03615 03573 03607 03756 03517 03770 03586 03586 03739 03727 03787(s2 c1) 03656 03671 03623 04047 04349 03805 04627 03929 04339 04365 04397 04929(s2 c2) 03705 03729 03678 04642 05176 04171 05916 04424 05504 05218 05327 06577(s2 c3) 03756 03792 03736 05377 06143 04624 07277 05067 06805 06183 06402 07939(s2 c4) 03812 03859 03799 06155 07056 05161 08380 05796 07856 07099 07388 08816(s2 c5) 03873 03930 03866 06887 07816 05751 09126 06517 08606 07864 08172 09331(s3 c0) 03622 03631 03588 03729 03912 03594 04004 03685 03795 03909 03909 04081(s3 c1) 03669 03687 03639 04200 04555 03901 04966 04062 04622 04587 04642 05334(s3 c2) 03719 03746 03694 04826 05423 04286 06295 04589 05833 05465 05607 06936(s3 c3) 03772 03811 03754 05572 06377 04762 07609 05248 07081 06420 06657 08175(s3 c4) 03829 03879 03818 06341 07254 05314 08620 05980 08054 07300 07593 08956(s3 c5) 03894 03954 03888 07056 07972 05909 09275 06689 08740 08022 08325 09412(s4 c0) 03635 03647 03602 03861 04082 03678 04274 03798 04015 04096 04114 04396(s4 c1) 03683 03704 03654 04362 04774 04005 05325 04211 04908 04814 04894 05730(s4 c2) 03734 03765 03712 05013 05664 04410 06667 04758 06142 05707 05875 07253(s4 c3) 03790 03833 03775 05765 06600 04905 07906 05429 07330 06644 06894 08375(s4 c4) 03851 03904 03841 06521 07439 05470 08824 06162 08230 07485 07782 09074(s4 c5) 03917 03981 03913 07218 08115 06067 09395 06857 08858 08165 08463 09480

percentage of turnover and it is the same as the assumptionin the experimental settings As in the US stock market thesmallest unit of price change is 001 (one tick) It is reasonableto set slippage to be 001-005 Of course it should be notedthat the prices fluctuation may be more intense when closingthan that in the middle of a trading day

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 28 the WR is decreasing with the increaseof transaction cost for any trading algorithm When thetransaction cost is set to (s c) = (004 0005) the WR of eachalgorithm is the smallest Comparedwith the settings withouttransaction cost the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR SVM and XGB are reduced by671 688 697 2269 1726 1548 2430 14912484 2112 2112 and 2919 respectively For a generalsetting of s and c ie (s c) = (002 0003) the WR ofMLP DBN and SAE decrease by 410 420 and 430respectively while the WR of other algorithms decrease bymore than 9 the WR of CART RF and XGB decrease by

more than 15 Therefore MLP DBN and SAE are moretolerant to transaction cost From single trading algorithmsuch as LSTM if we do not consider slippage ie s=0 theaverage WR of DBN is 05417 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage WR of LSTM is 05304 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the WR under the transactioncost structures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the WR without transaction cost for MLPDBN SAE and NB the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN SAE and NB the WR under the transaction coststructure (s0 c1) is not significantly different from the WRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

24 Mathematical Problems in Engineering

Table 28 The WR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803(s0 c1) 05523 05527 05525 05525 05608 05620 05009 05227 05612 05665 05571 05595(s0 c2) 05488 05492 05489 05389 05512 05535 04879 05149 05460 05542 05445 05411(s0 c3) 05453 05456 05452 05258 05414 05451 04747 05068 05313 05418 05320 05234(s0 c4) 05417 05419 05414 05127 05320 05368 04622 04991 05172 05297 05202 05067(s0 c5) 05383 05383 05379 05004 05230 05286 04504 04917 05036 05180 05088 04905(s1 c0) 05494 05499 05497 05444 05541 05558 04925 05170 05520 05584 05492 05488(s1 c1) 05456 05459 05456 05286 05424 05456 04775 05080 05342 05437 05345 05275(s1 c2) 05421 05423 05420 05161 05335 05377 04654 05007 05207 05320 05231 05110(s1 c3) 05386 05388 05383 05036 05246 05296 04530 04931 05065 05205 05116 04946(s1 c4) 05353 05354 05349 04915 05156 05218 04419 04861 04937 05095 05007 04795(s1 c5) 05323 05323 05317 04808 05076 05148 04315 04796 04817 04995 04905 04652(s2 c0) 05431 05434 05431 05219 05368 05403 04707 05036 05269 05374 05286 05189(s2 c1) 05395 05397 05393 05078 05266 05314 04573 04956 05115 05242 05154 05005(s2 c2) 05360 05361 05357 04960 05181 05237 04458 04886 04985 05134 05046 04853(s2 c3) 05331 05331 05326 04850 05100 05167 04352 04818 04864 05031 04945 04711(s2 c4) 05300 05300 05293 04743 05018 05093 04252 04752 04746 04931 04846 04572(s2 c5) 05273 05271 05266 04648 04946 05029 04159 04692 04639 04838 04755 04445(s3 c0) 05373 05374 05371 05019 05216 05265 04514 04917 05049 05186 05098 04932(s3 c1) 05341 05341 05336 04902 05128 05188 04399 04846 04917 05074 04990 04775(s3 c2) 05312 05312 05306 04798 05052 05122 04303 04782 04804 04977 04896 04644(s3 c3) 05281 05281 05275 04696 04976 05049 04206 04718 04689 04879 04799 04509(s3 c4) 05252 05251 05245 04598 04901 04984 04110 04657 04581 04785 04707 04378(s3 c5) 05226 05223 05218 04510 04833 04924 04023 04602 04481 04701 04621 04264(s4 c0) 05325 05325 05321 04860 05089 05150 04360 04816 04870 05030 04949 04723(s4 c1) 05294 05294 05289 04753 05010 05079 04258 04750 04752 04928 04849 04588(s4 c2) 05266 05265 05259 04653 04937 05013 04164 04690 04642 04838 04761 04458(s4 c3) 05238 05236 05230 04562 04864 04948 04073 04632 04541 04747 04672 04336(s4 c4) 05211 05208 05203 04475 04798 04891 03985 04577 04440 04662 04586 04218(s4 c5) 05186 05182 05176 04392 04733 04832 03901 04524 04348 04582 04509 04109

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 29 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the smallest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 5073 5175 and 5225 respectivelyWhile the ARR of other trading algorithms decrease bymore than 100 compared with those algorithms withouttransaction cost Therefore excessive transaction cost canlead to serious losses in the accounts For a general settingof s and c ie (s c) = (002 0003) ARR of MLP DBNand SAE decrease by 2741 2797 and 2825 respectivelywhile the ARR other algorithms decrease by more than 50and that of CART NB RF and XGB decrease by more than100 Therefore MLP DBN and SAE are more tolerant totransaction cost From single trading algorithm such as SAEif we do not consider slippage ie s=0 the average ARR ofSAE is 05040 under the transaction cost structure (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not consider

transparent transaction cost ie c=0 the averageARRof SAEis 04468 under the transaction cost structures (s1 c0) (s2c0) (s3 c0) (s4 c0) so transparent transaction cost hassmaller impact than slippage Through multiple comparativeanalysis the ARR under the transaction cost structures (s0c1) (s0 c2) (s0 c3) (s0 c1) (s1 c1) are not significantlydifferent from the ARR without transaction cost for MLPDBN and SAE the ARR under all other transaction coststructures are significantly smaller than the ARR withouttransaction cost For RNN LSTM GRU CART RF LR andSVM the ARR under the transaction cost structures (s0c1) (s0 c2) (s1 c0) are not significantly different fromthe ARR without transaction cost the ARR under all othertransaction cost structures are significantly smaller than theARR without transaction cost For NB and XGB the ARRunder the transaction cost structures (s0 c1) (s1 c0) arenot significantly different from the ARR without transactioncost the ARR under all other transaction cost structuresare significantly smaller than the ARR without transactioncost

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 6: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

6 Mathematical Problems in Engineering

In this paper ldquoUPrdquo is the profit source of our tradingstrategiesThe classification ability ofML algorithm is to eval-uate whether the algorithms can recognize ldquoUPrdquo Thereforeit is necessary to use PR and RR to evaluate classificationresults These two evaluation indicators are initially appliedin the field of information retrieval to evaluate the relevanceof retrieval results

PR is a ratio of the number of correctly predicted UP toall predicted UP That is as follows

119875119877 =119879119880

(119879119880 + 119865119880)(2)

High PR means that ML algorithms can focus on ldquoUPrdquorather than ldquoDOWNrdquo

RR is the ratio of the number of correctly predicted ldquoUPrdquoto the number of actually labeled ldquoUPrdquo That is as follows

119875119877 =119879119880

(119879119880 + 119865119863)(3)

High RR can capture a large number of ldquoUPrdquo and beeffectively identified In fact it is very difficult to present analgorithm with high PR and RR at the same time Thereforeit is necessary to measure the classification ability of theML algorithm by using some evaluation indicators whichcombine PR with RR F1-Score is the harmonic average ofPR and AR F1 is a more comprehensive evaluation indicatorThat is as follows

1198651= 2 lowast 119875119877 lowast

119860119877

(119875119877 + 119860119877)(4)

Here it is assumed that theweights of PR andRR are equalwhen calculating F1 but this assumption is not always correctIt is feasible to calculate F1 with different weights for PR andRR but determining weights is a very difficult challenge

AUC is the area under ROC (Receiver Operating Charac-teristic) curve ROC curve is often used to check the tradeoffbetween finding TU and avoiding FU Its horizontal axisis FU rate and its vertical axis is TU rate Each point onthe curve represents the proportion of TU under differentFU thresholds [36] AUC reflects the classification ability ofclassifier The larger the value the better the classificationability It is worth noting that two different ROC curves maylead to the same AUC value so qualitative analysis should becarried out in combination with the ROC curve when usingAUCvalue In this paper we use R language package ldquoROCRrdquoto calculate AUC

42 Performance Evaluation Indicator Performance evalua-tion indicator is used for evaluating the profitability and riskcontrol ability of trading algorithms In this paper we usetrading signals generated by ML algorithms to conduct thebacktesting and apply the WR ARR ASR and MDD to dothe trading performance evaluation [34] WR is a measureof the accuracy of trading signals ARR is a theoretical rateof return of a trading strategy ASR is a risk-adjusted returnwhich represents return from taking a unit risk [37] and therisk-free return or benchmark is set to 0 in this paper MDDis the largest decline in the price or value of the investmentperiod which is an important risk assessment indicator

43 Backtesting Algorithm Using historical data to imple-ment trading strategy is called backtesting In research andthe development phase of trading model the researchersusually use a new set of historical data to do backtesting Fur-thermore the backtesting period should be long enoughbecause a large number of historical data can ensure that thetrading model can minimize the sampling bias of data Wecan get statistical performance of tradingmodels theoreticallyby backtesting In this paper we get 1750 trading signals foreach stock If tomorrowrsquos trading signal is 1 we will buy thestock at todayrsquos closing price and then sell it at tomorrowrsquosclosing price otherwise we will not do stock trading Finallywe get AR PR RR F1 AUC WR ARR ASR and MDD byimplementing backtesting algorithm based on these tradingsignals

5 Comparative Analysis ofDifferent Trading Algorithms

51 Nonparametric Statistical Test Method In this part weuse the backtesting algorithm(Algorithm 2) to calculate theevaluation indicators of different trading algorithms In orderto test whether there are significant differences betweenthe evaluation indicators of different ML algorithms thebenchmark indexes and the BAH strategies it is necessaryto use analysis of variance and multiple comparisons to givethe answers Therefore we propose the following nine basichypotheses for significance test in which Hja (119895 = 1 2 3 45 6 7 8 9) are the null hypothesis and the correspondingalternative assumptions areHjb (119895 = 1 2 3 4 5 6 7 8 9)Thelevel of significance is 005

For any evaluation indicator 119895 isin 119860119877 119875119877 119877119877 1198651 119860119880119862119882119877119860119877119877 119860119878119877119872119863119863 and any trading strategy 119894 isin 119872119871119875119863119861119873 119878119860119864 119877119873119873 119871119878119879119872 119866119877119880 119871119877 119878119881119872 119873119861119862119860119877119879 119877119865119883119866119861119861119860119867 119861119890119899119888ℎ119898119886119903119896 119894119899119889119890119909 the null hypothesis a is Hjaalternative hypotheses b is Hjb (119895 = 1 2 3 4 5 6 7 8 9represent AR PR RR F1 AUC WR ARR ASR MDDrespectively)

Hja the evaluation indicator j of all strategies are thesameHjb the evaluation indicator j of all strategies are notthe same

It is worth noting that any evaluation indicator of alltrading algorithm or strategy does not conform to the basichypothesis of variance analysisThat is it violates the assump-tion that the variances of any two groups of samples are thesame and each group of samples obeys normal distributionTherefore it is not appropriate to use t-test in the analysisof variance and we should take the nonparametric statisticaltest method instead In this paper we use the Kruskal-Wallisrank sum test [38] to carry out the analysis of variance If thealternative hypothesis is established we will need to furtherapply the Nemenyi test [39] to do the multiple comparisonsbetween trading strategies

52 Comparative Analysis of Performance of Different TradingStrategies in SPICS Table 4 shows the average value of

Mathematical Problems in Engineering 7

Input TS TS is trading signals of a stockOutput AR PR RR F1 AUC WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) Bt=Benchmark Index [ldquoClosing Pricerdquo] B is the closing price of benchmark index(3) WR=NULL ARR=NULL ASR=NULL MDD=NULL(4) for (i in 1 N) (5) Stock Data=Stock Code List[i](6) Pt=Stock Data [ldquoClosing Pricerdquo](7) Labelt= Stock Data [ldquoLabelrdquo](8) BDRRt=(Bt-Bt-1) Bt-1 BDRR is the daily return rate of benchmark index(9) DRRt= (Pt-Pt-1)Pt-1 DRR is daily return rateThat is daily return rate of BAH strategy(10) TDRRt=lag (TSt)lowastDRRt TDRR is the daily return through trading(11) Table=Confusion Matrix(TS Label)(12) AR[i]=sum(adj(Table))sum(Table)(13) PR[i]=Table[2 2]sum(Table[ 2])(14) RR[i]=Table[2 2]sum(Table[2 ])(15) F1=2lowastPR[i]lowastRR[i](PR[i]+RR[i])(16) Pred=prediction (TS Label)(17) AUC[i]=performance (Pred measure=ldquoaucrdquo)yvalues[[1]](18) WR[i]=sum (TDRRgt0)sum(TDRR =0)(19) ARR[i]=Returnannualized (TDRR) TDRR BDRR or DRR can be used(20) ASR[i]=SharpeRatioannualized (TDRR) TDRR BDRR or DRR can be used(21) MDD[i]=maxDrawDown (TDRR) TDRR BDRR or DRR can be used(22) AR=c (AR AR[i])(23) PR=c (PR PR[i])(24) RR=c (RR RR[i])(25) F1=c (F1 F1[i])(26) AUC=c (AUC AUC[i])(27) WR=c (WR WR[i])(28) ARR=c (ARR ARR[i])(29) ASR=c (ASR ASR[i])(30) MDD=c (MDD MDD[i])(31) (32) Performance=cbind (AR PR RR F1 AUC WR ARR ASR MDD)(33) return (Performance)

Algorithm 2 Backtesting algorithm of daily trading strategy in R language

Table 4 Trading performance of different trading strategies in the SPICS Best performance of all trading strategies is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGBAR mdash mdash 05205 05189 05201 05025 05013 04986 06309 05476 06431 06491 06235 06600PR mdash mdash 07861 07764 07781 05427 05121 04911 06514 05270 06595 06474 06733 06738RR mdash mdash 05274 05263 05273 05245 05253 05239 06472 05762 06599 06722 06325 06767F1 mdash mdash 06258 06217 06229 05332 05183 05065 06491 05480 06595 06591 06517 06751AUC mdash mdash 05003 05001 05002 04997 05005 04992 06295 05489 06418 06491 06199 06590WR 05450 05235 05676 05680 05683 05843 05825 05844 05266 05930 05912 05859 05831 05891ARR 01227 01603 03333 03298 03327 02945 02921 02935 03319 02976 03134 02944 03068 03042ASR 08375 06553 15472 15415 15506 15768 15575 15832 13931 16241 16768 15822 16022 16302MDD 01939 04233 03584 03585 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338

various trading algorithms in AR PR RR F1 AUC WRARR ASR and MDD We can see that the AR RR F1 andAUC of XGB are the greatest in all trading algorithms TheWR of NB is the greatest in all trading strategies The ARRof MLP is the greatest in all trading strategies including thebenchmark index (SampP 500 index) and BAH strategy TheASR of RF is the greatest in all trading strategies TheMDDofthe benchmark index is the smallest in all trading strategies

It is worth noting that the ARR and ASR of all ML algorithmsare greater than those of BAH strategy and the benchmarkindex

(1) Through the hypothesis test analysis of H1a and H1bwe can obtain p valuelt22e-16

Therefore there are statistically significant differencesbetween the AR of all trading algorithms Therefore we needto make multiple comparative analysis further as shown in

8 Mathematical Problems in Engineering

Table 5Multiple comparison analysis between theAR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 10000GRU 00000 00000 00000 08273 09811CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00232 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 07649SVM 00000 00000 00000 00000 00000 00000 06057 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00002 02010 00000

Table 6Multiple comparison analysis between the PR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 09999SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00034GRU 00000 00000 00000 00000 01472CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 07869 05786 00000 00000RF 00000 00000 00000 00000 00000 00000 08056 00000LR 00000 00000 00000 00000 00000 00000 09997 00000 02626SVM 00000 00000 00000 00000 00000 00000 00008 00000 03104 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00491 00000 09999

Table 5 The number in the table is a p value of any two algo-rithms of Nemenyi test When p valuelt005 we think thatthe two trading algorithms have a significant differenceotherwise we cannot deny the null assumption that the meanvalues of AR of the two algorithms are equal From Tables 5and 4 we can see that the AR of all DNN models are signif-icantly lower than those of all traditional MLmodelsTheARof MLP DBN and SAE are significantly greater than those ofRNN LSTM and GRU There are no significant differencesamong the AR of MLP DBN and SAE There are no sig-nificant differences among the AR of RNN LSTM and GRU

(2) Through the hypothesis test analysis of H2a and H2bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between the PR of all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 6 The number in the table is a pvalue of any two algorithms of Nemenyi test From Tables 6and 4 we can see that the PR of MLP DBN and SAE aresignificantly greater than that of other trading algorithmsThe PR of LSTM is not significantly different from that ofGRU and NBThe PR of GRU is significantly lower than thatof all traditional ML algorithms The PR of NB is significantlylower than that of other traditional ML algorithms

(3) Through the hypothesis test analysis of H3a and H3bwe can obtain p valuelt22e-16 So there are statistically

significant differences between the RR of all trading algo-rithms Therefore we need to make multiple comparativeanalysis further as shown in Table 7 The number in thetable is a p value of any two algorithms of Nemenyi testFrom Tables 7 and 4 we can see that there is no significantdifference among the RR of all DNN models but the RRof any DNN model is significantly lower than that of alltraditional ML models The RR of NB is significantly lowerthan that of other traditional ML algorithms The RR ofCART is significantly lower than that of other traditional MLalgorithms except for NB

(4) Through the hypothesis test analysis of H4a and H4bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between the F1 of all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 8 The number in the table is a pvalue of any two algorithms of Nemenyi test From Tables8 and 4 we can see that there is no significant differenceamong the F1 of MLP DBN and SAE The F1 of MLP DBNand SAE are significantly greater than that of RNN LSTMGRU andNB but are significantly smaller than that of RF LRSVM and XGBThe F1 of GRU and LSTMhave no significantdifference but they are significantly smaller than that of alltraditional ML algorithms The F1 of XGB is significantlygreater than that of all other trading algorithms

Mathematical Problems in Engineering 9

Table 7Multiple comparison analysis between the RR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 10000 10000 10000LSTM 10000 10000 10000 10000GRU 09999 10000 09999 10000 10000CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00485 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 00555SVM 00000 00000 00000 00000 00000 00000 00197 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00010 09958 00000

Table 8Multiple comparison analysis between the F1 of any two trading algorithms The p value of the two trading strategies with significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 09998SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00810GRU 00000 00000 00000 00000 03489CART 00861 00061 00117 00000 00000 00000NB 00000 00000 00000 04635 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00078 00000LR 00000 00000 00000 00000 00000 00000 00173 00000 10000SVM 00007 00000 00000 00000 00000 00000 09797 00000 03336 04825XGB 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000

Table 9 Multiple comparison analysis between the AUC of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 10000 10000 10000LSTM 10000 10000 10000 09999GRU 10000 10000 10000 10000 09975CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00270 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 05428SVM 00000 00000 00000 00000 00000 00000 03125 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00002 03954 00000

(5) Through the hypothesis test analysis of H5a and H5bwe can obtain p valuelt22e-16 So there are statisticallysignificant differences between the AUC of all trading algo-rithms Therefore we need to make multiple comparativeanalysis further as shown in Table 9 The number in thetable is a p value of any two algorithms of Nemenyi testFrom Tables 9 and 4 we can see that there is no significantdifference among the AUC of all DNN models The AUC of

all DNN models are significantly smaller than that of anytraditional ML model

(6) Through the hypothesis test analysis of H6a and H6bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between theWRof all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 10 The number in the table is pvalue of any two algorithms of Nemenyi test From Tables 4

10 Mathematical Problems in Engineering

Table10M

ultip

lecomparis

onanalysisbetweentheW

Rof

anytwotradingalgorithm

sTh

epvalueo

fthe

twotradingstr

ategiesw

ithsig

nificantd

ifference

isin

boldface

Index

BAH

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

BAH

000

00MLP

000

00000

00DBN

000

00000

0010

000

SAE

000

00000

0010

000

1000

0RN

N000

00000

00000

00000

00000

00LSTM

000

00000

00000

00000

00000

0009974

GRU

000

11000

00000

01000

00000

0010

000

09961

CART

000

0009998

000

00000

00000

00000

00000

00000

00NB

000

00000

00000

00000

00000

00000

31000

00000

38000

00RF

000

00000

00000

00000

00000

0000118

000

0100140

000

0010

000

LR000

00000

00000

00000

00000

0010

000

08508

1000

0000

00004

320117

7SV

M000

00000

00000

00000

00000

0010

000

1000

010

000

000

00000

01000

0609780

XGB

000

00000

00000

00000

00000

0002660

000

8402927

000

0009831

09989

07627

00376

Mathematical Problems in Engineering 11

Table 11Multiple comparison analysis between theARRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00001 00006 00001LSTM 00000 00000 00000 00002 00000 10000GRU 00000 00000 00001 00008 00001 10000 10000CART 00000 00000 10000 10000 10000 00001 00000 00001NB 00000 00000 00021 00094 00022 10000 09998 10000 00018RF 00000 00000 07978 09524 08036 01685 00874 01962 07745 05861LR 00000 00000 00002 00012 00002 10000 10000 10000 00002 10000 02408SVM 00000 00000 02375 04806 02427 07029 05214 07457 02178 09778 09999 08015XGB 00000 00000 00674 01856 00694 09423 08466 09576 00600 09996 09905 09739 10000

Table 12Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 09667MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 08763 07617 08998LSTM 00000 00000 09922 09701 09949 10000GRU 00000 00000 06124 04563 06537 10000 09996CART 00000 00000 00002 00005 00002 00000 00000 00000NB 00000 00000 00467 00233 00557 09529 07037 09971 00000RF 00000 00000 00000 00000 00000 00291 00042 01062 00000 08010LR 00000 00000 07506 06025 07859 10000 10000 10000 00000 09872 00602SVM 00000 00000 01759 01020 02010 09982 09399 10000 00000 10000 04671 09998XGB 00000 00000 00099 00044 00122 07548 03776 09470 00000 10000 09681 08791 09997

and 10 we can see that the WR of MLP DBN and SAE haveno significant difference but they are significantly higherthan that of BAH and benchmark index and significantlylower than that of other trading algorithms TheWR of RNNLSTM and GRU have no significant difference but they aresignificantly higher than that of CART and significantly lowerthan that of NB and RF The WR of LR is not significantlydifferent from that of RF SVM and XGB

(7) Through the analysis of the hypothesis test of H7aand H7b we obtain p valuelt22e-16 Therefore there aresignificant differences between the ARR of all trading strate-gies including the benchmark index and BAH We needto do further multiple comparative analysis as shown inTable 11 From Tables 4 and 11 we can see that the ARR ofthe benchmark index and BAH are significantly lower thanthat of all ML algorithms The ARR of MLP DBN and SAEare significantly greater than that of RNN LSTM GRU NBand LR but not significantly different from that of CARTRF SVM and XGB there is no significant difference betweenthe ARR of MLP DBN and SAE The ARR of RNN LSTM

and GRU are significantly less than that of CART but theyare not significantly different from that of other traditionalML algorithms In all traditional ML algorithms the ARR ofCART is significantly greater than that of NB and LR butotherwise there is no significant difference between ARR ofany other two algorithms

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore there are significantdifferences between ASR of all trading strategies includingthe benchmark index and BAH The results of our multiplecomparative analysis are shown in Table 12 From Tables 4and 12 we can see that the ASR of the benchmark index andBAH are significantly smaller than that of all ML algorithmsThe ASR of MLP and DBN are significantly greater than thatof CART and are significantly smaller than that of NB RFand XGB but there is no significant difference between MLPDBN and other algorithms The ASR of SAE is significantlygreater than that of CART and significantly less than that ofRF and XGB but there is no significant difference betweenSAE and other algorithms The ASR of RNN and LSTM

12 Mathematical Problems in Engineering

Table 13 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00052DBN 00000 00031 10000SAE 00000 00012 10000 10000RNN 00000 00000 01645 02243 03556LSTM 00000 00000 06236 07173 08511 10000GRU 00000 00000 00245 00381 00760 10000 09860CART 00000 00000 01496 02057 03309 10000 10000 10000NB 00000 00000 00786 01136 01999 10000 09994 10000 10000RF 00000 00000 00002 00004 00012 08964 04248 09980 09109 09713LR 00000 00000 05451 06428 07935 10000 10000 09933 10000 09998 05015SVM 00000 00000 02433 03194 04734 10000 10000 09999 10000 10000 08155 10000XGB 00000 00000 00103 00167 00360 09998 09462 10000 09999 10000 09998 09685 09989

Table 14 Trading performance of different trading strategies in CSICS Best performance of all trading strategies is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGBAR mdash mdash 05175 05167 05163 05030 04993 04993 05052 05084 05090 05084 05112 05087PR mdash mdash 07548 07436 07439 05414 04964 04956 05022 05109 05128 04967 05695 05026RR mdash mdash 05252 05250 05248 05234 05224 05223 05279 05307 05311 05318 05295 05315F1 mdash mdash 06150 06108 06108 05320 05086 05082 05143 05192 05214 05132 05483 05164AUC mdash mdash 05027 05024 05020 05006 04995 04996 05049 05078 05082 05086 05074 05085WR 05222 05090 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803ARR 00633 02224 05731 05704 05678 05248 05165 05113 05534 06125 04842 05095 05004 04938ASR 02625 04612 14031 14006 13935 14880 15422 15505 12232 11122 14379 15582 14231 14698MDD 04808 06697 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632

are significantly greater than that of CART and significantlyless than that of RF but there is no significant differencebetweenRNN LSTM and other algorithmsTheASRofGRUis significantly greater than that of CART but there is nosignificant difference between GRU and other traditional MLalgorithms In all traditional ML algorithms the ASR of allalgorithms are significantly greater than that of CART butotherwise there is no significant difference between ASR ofany other two algorithms

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between MDD of trading strategies includingthe benchmark index and the BAH The results of multiplecomparative analysis are shown in Table 13 From Tables4 and 13 we can see that MDD of any ML algorithm issignificantly greater than that of the benchmark index butsignificantly smaller than that of BAH strategy The MDDof MLP and DBN are significantly smaller than those ofGRU RF and XGB but there is no significant differencebetween MLP DBN and other algorithms The MDD ofSAE is significantly smaller than that of XGB but there isno significant difference between SAE and other algorithmsOtherwise there is no significant difference betweenMDDofany other two algorithms

In a word the traditional ML algorithms such as NBRF and XGB have good performance in most directional

evaluation indicators such as AR PR and F1 The DNNalgorithms such as MLP have good performance in PR andARR In traditional ML algorithms the ARR of CART RFSVM and XGB are not significantly different from that ofMLP DBN and SAE the ARR of CART is significantlygreater than that of LSTM GRU and RNN but otherwisethe ARR of all traditional ML algorithms are not significantlyworse than that of LSTM GRU and RNN The ASR of alltraditional ML algorithms except CART are not significantlyworse than that of the six DNNmodels even the ASR of NBRF and XGB are significantly greater than that of some DNNalgorithms The MDD of RF and XGB are significantly lessthat of MLP DBN and SAE the MDD of all traditional MLalgorithms are not significantly different from that of LSTMGRU and RNNThe ARR and ASR of all ML algorithms aresignificantly greater than that of BAH and the benchmarkindex the MDD of any ML algorithm is significantly greaterthan that of the benchmark index but significantly less thanthat of BAH strategy

53 Comparative Analysis of Performance of Different TradingStrategies in CSICS The analysis methods of this part aresimilar to Section 52 From Table 14 we can see that the ARPR and F1 of MLP are the greatest in all trading algorithmsThe RR AUC WR and ASR of LR are the greatest inall trading algorithms respectively The ARR of NB is the

Mathematical Problems in Engineering 13

Table 15Multiple comparison analysis between theARof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 01857GRU 00000 00000 00000 04439 10000CART 00000 00000 00000 09765 00024 00131NB 00000 00001 00002 00022 00000 00000 01810RF 00000 00002 00005 00007 00000 00000 00941 10000LR 00000 00000 00000 00076 00000 00000 03454 10000 10000SVM 00217 00766 01309 00000 00000 00000 00003 08314 09352 06360XGB 00000 00001 00001 00025 00000 00000 01930 10000 10000 10000 08168

Table 16Multiple comparison analysis between the PRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 09906 09781NB 00000 00000 00000 00000 01716 01234 08940RF 00000 00000 00000 00000 00319 00205 05271 10000LR 00000 00000 00000 00000 10000 10000 09951 02099 00422SVM 00000 00000 00000 01157 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00000 09922 09811 10000 08836 05086 09960 00000

highest in all trading strategies The MDD of CSI 300 index(benchmark index) is the smallest in all trading strategiesTheWRARR and ASR of all ML algorithms are greater thanthose of the benchmark index and BAH strategy

(1) Through the hypothesis test analysis of H1a and H1bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the AR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 15The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 15 we can see that the AR ofMLPDBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms except for SVM The ARof GRU is significantly smaller than that of all traditional MLalgorithms There is no significant difference between the ARof any two traditional ML algorithms except for CART andSVM

(2) Through the hypothesis test analysis of H2a and H2bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the PR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 16 The number in the tableis a p value of any two algorithms of Nemenyi test FromTables 14 and 16 we can see that the PR of MLP DBN and

SAE are significantly greater than that of all other tradingalgorithms and the PR of MLP DBN and SAE have nosignificant difference The PR of SVM is significantly greaterthan that of all other traditional ML algorithms which haveno significant difference between any two algorithms exceptfor SVM The PR of RNN is significantly greater than thatof all traditional ML algorithms except for SVM The PR ofGRU and LSTM are not significantly different from that of alltraditional ML algorithms except for SVM and LR

(3) Through the hypothesis test analysis of H3a and H3bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the RR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 17 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 17 we can see that the RR of all DNN models arenot significantly different There is no significant differenceamong the RR of all traditional ML algorithms The RR ofRNN GRU and LSTM are significantly smaller than that ofany traditional ML algorithm except for CART

(4) Through the hypothesis test analysis of H4a and H4bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the F1 of all trading algorithms There-fore we need to do further multiple comparative analysis and

14 Mathematical Problems in Engineering

Table 17Multiple comparison analysis between the RRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 09996 09996 10000LSTM 09309 09314 09781 09999GRU 09660 09663 09916 10000 10000CART 09744 09742 09225 05809 01509 02138NB 01093 01088 00574 00075 00004 00007 08861RF 00537 00534 00260 00028 00001 00002 07544 10000LR 00330 00328 00152 00015 00001 00001 06498 10000 10000SVM 03444 03434 02170 00434 00033 00059 09920 10000 09998 09991XGB 00193 00192 00085 00007 00000 00000 05344 10000 10000 10000 09960

Table 18 Multiple comparison analysis between the F1 of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 07211 06670NB 00000 00000 00000 00136 00132 00099 08664RF 00000 00000 00000 00786 00016 00011 05162 10000LR 00000 00000 00000 00000 09440 09208 10000 05675 02181SVM 00000 00000 00000 00178 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00001 03138 02679 10000 09937 08849 09964 00000

Table 19 Multiple comparison analysis between the AUC of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 09999 10000RNN 09945 09985 10000LSTM 05273 06382 09259 09937GRU 08448 09102 09958 10000 10000CART 06921 05835 02356 00801 00014 00096NB 00002 00001 00000 00000 00000 00000 02616RF 00001 00001 00000 00000 00000 00000 02002 10000LR 00000 00000 00000 00000 00000 00000 00930 10000 10000SVM 00027 00014 00001 00000 00000 00000 06454 10000 09999 09980XGB 00000 00000 00000 00000 00000 00000 01257 10000 10000 10000 09993

the results are shown in Table 18The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 18 we can see that the F1 of MLP DBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms There is no significantdifference among traditionalML algorithms except SVM andthe F1 of SVM is significantly greater than that of all othertraditional ML algorithms

(5) Through the hypothesis test analysis of H5a and H5bwe can obtain p valuelt22e-16Therefore there are significantdifferences between theAUCof all trading algorithmsThere-fore we need to do further multiple comparative analysis andthe results are shown in Table 19 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 19 we can see that the AUC of all DNN models haveno significant difference There is no significant difference

Mathematical Problems in Engineering 15

Table 20 Multiple comparison analysis between the WR of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 04117MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00002 00006 00000LSTM 00000 00000 00000 00000 00000 09772GRU 00000 00000 00000 00000 00000 09911 10000CART 09931 00000 00000 00000 00000 00000 00000 00000NB 00031 00000 00001 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00205 06437 05358 00000 00000LR 00000 00000 00000 00000 00000 00010 01611 01105 00000 00000 10000SVM 00000 00000 00000 00000 00000 09914 10000 10000 00000 00000 05322 01090XGB 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000

Table 21Multiple comparison analysis between theARRof any two trading strategiesThepvalue of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00007MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 04790 06355 07182LSTM 00000 00000 02512 03806 04630 10000GRU 00000 00000 02235 03454 04249 10000 10000CART 00000 00000 08301 09217 09542 10000 09999 09998NB 00000 00000 10000 10000 10000 02920 01295 01125 06517RF 00000 00000 00020 00048 00076 08705 09735 09806 05393 00006LR 00000 00000 02058 03222 03995 10000 10000 10000 09996 01019 09845SVM 00000 00000 10000 00803 01114 09993 10000 10000 09659 00165 09999 10000XGB 00000 00000 10000 00333 00484 09916 09997 09998 08789 00057 10000 09999 10000

between the AUC of all traditional ML algorithms TheAUC of all traditional ML algorithms except for CART aresignificantly greater than that of any DNN model There isno significant difference among the AUC ofMLP SAE DBNRNN and CART

(6)Through the hypothesis test analysis of H6a and H6bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the WR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 20 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 20 we can see that the WR of BAH and benchmarkindex have no significant difference but they are significantlysmaller than that of anyML algorithmTheWRofMLPDBNand SAE are significantly smaller than that of the other trad-ing algorithms but there is no significant difference betweenthe WR of MLP DBN and SAE The WR of LSTM andGRU have no significant difference but they are significantlysmaller than that of XGB and significantly greater than that of

CART and NB In traditional MLmodels the WR of NB andCART are significantly smaller than that of other algorithmsThe WR of XGB is significantly greater than that of all otherML algorithms

(7)Through the analysis of the hypothesis test of H7a andH7b we obtain p valuelt22e-16

Therefore there are significant differences between theARR of all trading strategies including the benchmark indexand BAH strategy Therefore we need to do further multiplecomparative analysis and the results are shown in Table 21FromTables 14 and 21 we can see that ARR of the benchmarkindex and BAH are significantly smaller than that of alltrading algorithms The ARR of MLP is significantly higherthan that of RF but there is no significant difference betweenMLP and other algorithms The ARR of SAE and DBN aresignificantly higher than that of RF and XGB but they arenot significantly different fromARR of other algorithms TheARR of NB is significantly higher than that of RF SVMand XGB But otherwise there is no significant difference

16 Mathematical Problems in Engineering

Table 22Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 08877MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 09099 08862 08114LSTM 00000 00000 03460 03080 02239 09999GRU 00000 00000 02132 01853 01270 09981 10000CART 00000 00000 00158 00195 00327 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000 00000 07298RF 00000 00000 10000 10000 10000 09968 07444 05789 00018 00000LR 00000 00000 01181 01003 00650 09879 10000 10000 00000 00000 04044SVM 00000 00000 10000 10000 10000 09849 05952 04238 00042 00000 10000 02704XGB 00000 00000 09937 09902 09746 10000 09878 09532 00001 00000 10000 08723 09998

Table 23 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00006DBN 00000 00004 10000SAE 00000 00023 10000 10000RNN 00000 00000 00320 00421 00111LSTM 00000 00000 00002 00003 00000 09947GRU 00000 00000 00001 00001 00000 09767 10000CART 00000 00000 01238 01538 00521 10000 09241 08305NB 00000 01875 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 01180 01469 00493 10000 09298 08401 10000 00000LR 00000 00000 00001 00002 00000 09881 10000 10000 08821 00000 08898SVM 00000 00000 03285 03839 01701 09999 07011 05424 10000 00000 10000 06216XGB 00000 00000 00308 00405 00106 10000 09951 09783 10000 00000 10000 09890 09998

between any other two algorithms Therefore the ARR ofmost traditional ML models are not significantly worse thanthat of the best DNNmodel

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore There are significantdifferences betweenASRof all trading strategies including thebenchmark index and BAH strategy The results of multiplecomparative analysis are shown in Table 22 From Tables 14and 22 we can see that the ASR of the benchmark indexand BAH are significantly smaller than that of all tradingalgorithms The ASR of all ML algorithms are significantlyhigher than that of CART and NB but there is no significantdifference between the ASR of CART and NB Beyond thatthere is no significant difference between any other twoalgorithms Therefore the ASR of all traditional ML modelsexcept NB and CART are not significantly worse than that ofany DNNmodel

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between the MDD of these trading strategies

including the benchmark index and the BAH strategyThe results of multiple comparative analysis are shown inTable 23 From Tables 14 and 23 we can see that the MDDof the benchmark index is significantly smaller than that ofother trading strategies including BAH strategy TheMDD ofBAH is significantly greater than that of all trading algorithmsexcept NBTheMDDofMLPDBN and SAE are significantlylower than that of NB but significantly higher than thatof RNN LSTM GRU LR and XGB The MDD of NB issignificantly greater than that of all other trading algorithmsBeyond that there is no significant difference between anyother two algorithms Therefore all ML algorithms expectNB especially LSTM RNN GRU LR and XGB can play arole in controlling trading risk

In a word some DNN models such as MLP DBN andSAE have good performance in AR PR and F1 traditionalML algorithms such as LR and XGB have good performanceinAUCandWRTheARRof some traditionalML algorithmssuch as CART NB LR and SVM are not significantlydifferent from that of the six DNN models The ASR of the

Mathematical Problems in Engineering 17

six DNN algorithms are not significantly different from alltraditional ML models except NB and CART The MDD ofLR and XGB are significantly smaller than those of MLPDBN and SAE and are not significantly different fromthat of LSTM GRU and RNN The ARR and ASR of allML algorithms are significantly greater than those of BAHand benchmark index the MDD of all ML algorithms aresignificantly smaller than that of the benchmark index butsignificantly greater than that of BAH strategy

From the above analysis and evaluation we can see thatthe directional evaluation indicators of some DNN modelsare very competitive in CSICS while the indicators of sometraditional ML algorithms have excellent performance inSPICS Whether in SPICS or CSICS the ARR and ASR ofall ML algorithms are significantly greater than that of thebenchmark index and BAH strategy respectively In all MLalgorithms there are always some traditional ML algorithmswhich are not significantly worse than the best DNN modelfor any performance evaluation indicator (ARR ASR andMDD)Therefore if we do not consider transaction cost andother factors affecting trading performance of DNN modelsare alternative but not the best choice when they are appliedto stock trading

In the same period the ARR of any ML algorithm inCSICS is significantly greater than that of the same algorithmin SPICS (p valuelt0001 in theNemenyi test)Meanwhile theMDD of any ML algorithm in CSICS is significantly greaterthan that of the same algorithm in SPICS (p value lt0001in the Nemenyi test) The results show that the quantitativetrading algorithms can more easily obtain excess returns inthe Chinese A-share market but the volatility risk of tradingin Chinese A-share market is significantly higher than that ofthe US stock market in the past 8 years

6 The Impact of Transaction Cost onPerformance of ML Algorithms

Trading cost can affect the profitability of a stock tradingstrategy Transaction cost that can be ignored in long-termstrategies is significantly magnified in daily trading Howevermany algorithmic trading studies assume that transactioncost does not exist ([10 17] etc) In practice frictions suchas transaction cost can distort the market from the perfectmodel in textbooks The cost known prior to trading activityis referred to as transparent such as commissions exchangefees and taxes The costs that has to be estimated are knownas implicit including comprise bid-ask spread latency orslippage and related market impact This section focuses onthe transparent and implicit cost and how do they affecttrading performance in daily trading

61 Experimental Settings and Backtesting Algorithm In thispart the transparent transaction cost is calculated by a certainpercentage of transaction turnover for convenience theimplicit transaction cost is very complicated in calculationand it is necessary to make a reasonable estimate for therandom changes of market environment and stock pricesTherefore we only discuss the impact of slippage on tradingperformance

The transaction cost structures of American stocks aresimilar to that of Chinese A-shares We assume that transpar-ent transaction cost is calculated by a percentage of turnoversuch as less than 05 [40 41] and 02 and 05 in theliterature [42] It is different for the estimation of slippage

In some quantitative trading simulation software such asJoinQuant [43] and Abuquant [44] the slippage is set to 002The transparent transaction cost and implicit transaction costare charged in both directions when buying and selling Itis worth noting that the transparent transaction cost varieswith the different brokers while the implicit transaction costis related to market liquidity market information networkstatus trading software etc

We set slippages s = s0=0 s1=001 s2=002 s3=003s4=004 the transparent transaction cost c = c0=0 c1=0001c2=0002 c3=0003 c4=0004 c5=0005 For different s ccombinations we study the impact of different transactioncost structures on trading performance We assume thatbuying and selling positions are one unit so the turnover isthe corresponding stock price When buying stocks we notonly need to pay a certain percentage cost of the purchaseprice but also need to pay an uncertain slippage cost Thatis we need to pay a higher price than the real-time price119875119905minus1

when we are buying But when selling stocks we notonly need to pay a certain percentage cost of the sellingprice but also to pay an uncertain slippage cost Generallyspeaking we need to sell at a price lower than the real-timeprice 119875

119905 It is worth noting that our trading strategy is self-

financing If ML algorithms predict the continuous occur-rence of buying signals or selling signals ie |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 0 we will continue to hold or do nothingso the transaction cost at this time is 0 when |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 1 it is indicated that the position maybe changed from holding to selling or from empty positionto buying At this time we would pay transaction costdue to the trading operation Finally we get a real yieldis

119877119890119905119905le119862119897119900119904119890119875119903119894119888119890

119905minus 119862119897119900119904119890119875119903119894119888119890

119905minus1

119862119897119900119904119890119875119903119894119888119890119905minus1

119875119905= 119862119897119900119904119890119875119903119894119888119890

119905

lowast (1 minus 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816)

minus 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816

119875119905minus1

= 119862119897119900119904119890119875119903119894119888119890119905minus1

lowast (1 + 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816)

+ 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816

119877119890119905119905=119875119905minus 119875119905minus1

119875119905minus1

(5)

where 119862119897119900119904119890119875119903119894119888119890119905

denotes the 119905-th closing price119879119903119886119889119890119878119894119892119899119886119897

119905denotes the 119905-th trading signal 119875

119905denotes

the 119905-th executing price and 119877119890119905119905denotes the 119905-th return rate

We propose a backtesting algorithm with transaction costbased on the above analysis as is shown in Algorithm 3

18 Mathematical Problems in Engineering

Input TS TS is trading signals of a stocks s is slippagec c is transparent transaction cost

Output WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) WR=NULL ARR=NULL ASR=NULL MDD=NULL(3) for (i in 1 N) (4) Stock Data=Stock Code List[i](5) ClosePricet=Stock Data [ldquoClosing Pricerdquo](6) Pt =ClosePricet lowast(1-clowastabs(TSt-TSt-1)) - slowastabs(TSt-TSt-1)(7) Pt-1 =ClosePricetlowast(1+clowastabs(TSt-TSt-1)) + slowastabs(TSt-TSt-1)(8) Rett= (Pt- Pt-1) Pt Ret is the return rate series(9) TDRR=lag (TS)lowastRet TDRR is the daily return through trading(10) WR[i]=sum (TDRRgt0)sum(TDRR =0)(11) ARR[i]=Returnannualized (TDRR)(12) ASR[i]=SharpeRatioannualized (TDRR)(13) MDD[i]=maxDrawDown (TDRR)(14) WR=c (WR WR[i])(15) ARR=c (ARR ARR[i])(16) ASR=c (ASR ASR[i])(17) MDD=c (MDD MDD[i])(18) (19) return (WR ARR ASR MDD)

Algorithm 3 Backtesting algorithm with transaction cost in R language

62 Analysis of Impact of Transaction Cost on the TradingPerformance of SPICS Transaction cost is one of the mostimportant factors affecting trading performance In US stocktrading transparent transaction cost can be charged accord-ing to a fixed fee per order or month or a floating fee basedon the volume and turnover of each transaction Sometimescustomers can also negotiate with broker to determinetransaction cost The transaction cost charged by differentbrokers varies greatly Meanwhile implicit transaction costis not known beforehand and the estimations of them arevery complex Therefore we assume that the percentageof turnover is the transparent transaction cost for ease ofcalculation In the aspect of implicit transaction cost we onlyconsider the impact of slippage on trading performance

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 24 WR is decreasing with the increase oftransaction cost for any trading algorithm which is intuitiveWhen the transaction cost is set to (s c) = (004 0005) theWR of each algorithm is the lowest Compared with setting(s c) = (0 0) the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR and SVM to XGB are reduced by580 597 591 1583 1804 1395 2171 16042216 1854 1850 and 2597 respectively ThereforeMLP DBN and SAE are more tolerant to transaction costGenerally speaking the DNN models have stronger capacityto accommodate transaction cost than the traditional MLmodels From the single trading algorithm such as MLP ifwe do not consider slippage ie s=0 the average WR ofMLP is 05510 under transaction cost structures (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not considertransparent transaction cost ie c=0 the averageWRofMLP

is 05618 under transaction cost structures (s1 c0) (s2 c0)(s3 c0) (s4 c0) so transparent transaction cost has greaterimpact than slippageThroughmultiple comparative analysisthe WR under the transaction cost structure (s1 c0) is notsignificantly different from the WR without transaction costfor MLP DBN and SAETheWR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the WR under the transaction cost structure (s1 c0) (s2 c0) are not significantly different from theWRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 25 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the lowest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 4031 4157 and 4093 respectivelywhile the ARR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin accounts For a general setting of s and c ie (s c) = (0020003) ARR of MLP DBN and SAE decrease by 23262400 and 2361 respectively while the ARR of otheralgorithms decrease by more than 50 and that of CARTand XGB decrease bymore than 100ThereforeMLP DBNand SAE are more tolerant to high transaction cost Fromsingle trading algorithm such as RNN if we do not considerslippage ie s=0 the average ARR of RNN is 01434 under

Mathematical Problems in Engineering 19

Table24Th

eWRof

SPICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

05676

05680

05683

05843

05825

05844

05266

05930

05912

05859

05831

05891

(s0c1)

05615

05618

05621

05669

05626

05694

05052

05752

05663

05654

05630

05599

(s0c2)

05560

05560

05564

05507

05442

05553

04847

05585

05429

05463

05438

05324

(s0c3)

05507

05506

05510

05353

05269

05418

04652

05424

05205

05278

05253

05061

(s0c4)

05457

05454

05460

05206

05101

05289

044

7005277

04996

05105

05084

04818

(s0c5)

05410

05407

05412

05071

04946

05170

04303

05138

04803

04947

04924

04594

(s1c0)

056

49056

53056

5605778

05751

05785

05190

058

61058

2405782

05759

05788

(s1c1)

05594

05597

05600

05619

05571

05648

04991

05700

05597

05595

05574

05521

(s1c2)

05539

05539

05544

05458

05389

05508

04788

05534

05364

05406

05383

05249

(s1c3)

05487

05486

05491

05305

05215

05375

04597

05375

05141

05223

05200

04988

(s1c4)

05438

05436

05441

05163

05052

05249

044

1805231

04938

05054

05034

04750

(s1c5)

05394

05390

05396

05032

04902

05132

04255

05097

04751

04900

04880

04532

(s2c0)

05628

05631

05635

05729

056

9705741

05134

058

1105758

05726

05704

05713

(s2c1)

05573

05574

05578

05568

05515

05602

04931

05647

05527

05535

05515

05442

(s2c2)

05518

05518

05523

05408

05336

05463

04729

05482

05297

05349

05326

05172

(s2c3)

05469

05467

05472

05260

05164

05334

04543

05330

05082

05171

05150

04918

(s2c4)

05421

05417

05423

05120

05004

05209

04368

05187

04881

05004

04986

046

85(s2c5)

05377

05373

05379

04993

04858

05096

04209

05055

04699

04855

04835

044

73(s3c0)

05606

05609

05612

05678

05640

05694

05074

05759

05690

05668

05646

05635

(s3c1)

05552

05553

05558

05518

05460

05556

04872

05595

05460

05478

05459

05365

(s3c2)

05499

05498

05503

05362

05284

05422

046

7505434

05233

05295

05273

05099

(s3c3)

05450

05448

05453

05216

05114

05292

04491

05284

05020

05120

05098

04849

(s3c4)

05405

05401

05407

05080

04960

05172

04321

05146

04827

04959

04940

04622

(s3c5)

05362

05357

05363

04955

04816

05063

04166

05017

04651

04815

04793

044

17(s4c0)

05587

05589

05593

05630

05588

05652

05019

05710

05627

05613

05593

05562

(s4c1)

05533

05533

05537

05470

05407

05513

04815

05544

05395

05424

05404

05290

(s4c2)

05480

05479

05484

05316

05232

05380

04620

05386

05171

05242

05220

05026

(s4c3)

05432

05429

05435

05172

05067

05253

044

4005241

04964

05070

05051

04782

(s4c4)

05388

05384

05391

05041

04917

05137

04274

05106

04775

04914

04897

04564

(s4c5)

05347

05341

05347

04918

04774

05029

04123

04979

046

0204773

04752

04361

20 Mathematical Problems in Engineering

Table25Th

eARR

ofSP

ICSford

ailytradingwith

different

transactioncost

Ther

esultthatthere

isno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

03332

03296

03325

02943

02920

02934

03317

02975

03133

02942

03067

03041

(s0c1)

03128

030

8703118

02439

02327

02521

02266

02496

02384

02336

02400

02137

(s0c2)

02924

02879

02912

01936

01735

02108

01216

02017

01636

01731

01734

01234

(s0c3)

02721

02672

02706

01433

0114

301697

00168

01539

00889

01126

01070

00333

(s0c4)

02519

02464

02500

00931

00553

01285

-00878

01062

00143

00522

004

06-00567

(s0c5)

02316

02257

02294

00430

-00037

00875

-019

2400586

-00602

-0008

-00257

-014

66(s1c0)

03249

03212

03242

027

7802729

02794

029

53028

18028

9802747

028

5502762

(s1c1)

03046

03004

03035

02274

02136

02381

01902

02339

02149

02141

02188

01859

(s1c2)

02842

02796

02829

01771

01544

01969

00853

01861

01401

01536

01523

00957

(s1c3)

02639

02588

02623

01269

00953

01557

-00195

01383

00654

00931

00858

000

56(s1c4)

02437

02381

02417

00767

00363

0114

6-012

41009

06-00091

00328

00195

-00844

(s1c5)

02234

02174

02211

00266

-00226

00735

-02285

00430

-00836

-00275

-0046

8-01742

(s2c0)

03167

03129

03159

026

1302538

026

54025

89026

61026

6302551

026

43024

84(s2c1)

02964

02921

02952

02110

01946

02241

01539

02182

01914

01946

01977

01581

(s2c2)

0276

02713

02746

01607

01354

01829

00490

01704

0116

701341

01312

006

79(s2c3)

02557

02505

02540

0110

400763

01418

-00557

01227

004

2000737

006

47-00221

(s2c4)

02355

02298

02334

006

0300173

01007

-016

0300750

-00325

00134

-00016

-01120

(s2c5)

02153

02091

02129

00102

-00416

00597

-0264

700274

-010

69-00469

-00678

-02018

(s3c0)

030

85030

46030

7602448

02348

02514

02225

02504

02428

02356

02431

02206

(s3c1)

02881

02838

02869

01945

01756

02102

0117

502026

01680

01751

01765

01304

(s3c2)

02678

02630

02663

01442

01164

01690

00127

01548

00933

0114

601100

004

02(s3c3)

02476

02422

02457

00940

00574

01279

-00919

01071

00187

00543

00436

-00498

(s3c4)

02273

02215

02252

00439

-00016

00868

-019

6400595

-00558

-0006

-00227

-013

97(s3c5)

02071

02008

02047

-00062

-0060

5004

58-0300

800119

-013

02-00662

-00889

-02294

(s4c0)

03003

02962

02993

02284

02157

02374

01862

02348

02193

02161

02219

01929

(s4c1)

02799

02754

02786

01781

01565

01962

00813

01870

01445

01556

01554

01026

(s4c2)

02597

02547

02580

01278

00974

01551

-00235

01392

00699

00952

00889

00125

(s4c3)

02394

02339

02375

00776

00384

0114

0-012

8100915

-0004

700349

00226

-00774

(s4c4)

02192

02132

02169

00275

-00205

00729

-02326

00439

-00792

-00254

-00437

-016

73(s4c5)

01989

01926

01964

-00225

-00794

00319

-033

69-00037

-015

35-00856

-010

99-02570

Mathematical Problems in Engineering 21

the transaction cost structures (s0 c1) (s0 c2) (s0 c3) (s0c4) (s0 c5) if we do not consider transparent transactioncost ie c=0 the average ARR of RNN is 02531 under thetransaction cost structure (s1 c0) (s2 c0) (s3 c0) (s4c0) so transparent transaction cost has greater impact thanslippage Through multiple comparative analysis the ARRunder the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s0 c1) are not significantly different from the ARRwithout transaction cost for MLP DBN and SAE the ARRunder all other transaction cost structures are significantlysmaller than theARRwithout transaction cost For all tradingalgorithms except for MLP DBN and SAE the ARR underthe transaction cost structures (s1 c0) (s2 c0) are notsignificantly different from the ARR without transactioncost the ARR under all other transaction cost structures aresignificantly smaller than the ARR without transaction cost

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 26 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theASR of each algorithm is the lowest Compared with settingwithout transaction cost the ASR of MLP DBN and SAEreduce by 3997 4123 and 4066 respectively while theASR of other trading algorithms reduce by more than 90compared with the case of no transaction cost Thereforeexcessive transaction cost will significantly reduce ASR Fora general setting of s and c ie (s c) = (002 0003) theASR of MLP DBN and SAE decrease by 2262 2336and 2302 respectively while the ASR of other algorithmsdecrease by more than 50 the ASR of CART and XGBdecrease by more than 100Therefore MLP DBN and SAEare more tolerant to transaction cost From single tradingalgorithm such as NB if we do not consider slippage ies=0 the average ASR of NB is 08052 under the transactioncost structure (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5)if we do not consider transparent transaction cost ie c=0the average ASR of NB is 14182 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has greater impact than slippage Throughmultiple comparative analysis the ASR under the transactioncost structures (s1 c0) (s2 c0) (s3 c0) (s0 c1) are notsignificantly different from the ASR without transaction costfor MLP DBN and SAE the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the ASR under the transaction cost structures(s1 c0) (s2 c0) are not significantly different from the ASRwithout transaction cost the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 27 MDD increases with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the settings without transaction cost theMDD of MLP DBN and SAE increase by 932 1108 and

1032 respectively The MDD of other trading algorithmsincrease by more than 80 compared with those withoutconsidering transaction costTherefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 483 580 and 533respectively while the MDD of other algorithms increase bymore than 35 and theMDDofCART RF andXGB increasebymore than 100Therefore MLP DBN and SAE are moretolerant to transaction cost As awhole theDNNmodels havestronger capacity to accommodate transaction cost than thetraditional ML models From single trading algorithm suchas GRU if we do not consider slippage ie s=0 the averageMDD of GRU is 04459 under the transaction cost structures(s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do notconsider transparent transaction cost ie c=0 the averageMDD of GRU is 03559 under the transaction cost structures(s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparent transactioncost has greater impact than slippage Through multiplecomparative analysis the MDD under any the transactioncost structure is not significantly different from the MDDwithout transaction cost for MLP DBN and SAE For alltrading algorithms except for MLP DBN and SAE such asLR the MDD under the transaction cost structures (s0 c1)(s1 c0) (s2 c0) (s3 c0) are not significantly different fromthe MDD without transaction cost the MDD under all othertransaction cost structures are significantly greater than theMDD without transaction cost

Through the analysis of the Table 27 performance eval-uation indicators we find that trading performance afterconsidering transaction cost will be worse than that withoutconsidering transaction cost as is in actual trading situationIt is noteworthy that the performance changes of DNNalgorithms especially MLP DBN and SAE are very smallafter considering transaction cost This shows that the threealgorithms have good tolerance to changes of transactioncost Especially for the MDD of the three algorithms thereis no significant difference with that with no transactioncost So we can consider applying them in actual tradingMeanwhile we conclude that the transparent transactioncost has greater impact on the trading performances thanthe slippage for SPICS This is because the prices of SPICSare too high when the transparent transaction cost is setto a certain percentage of turnover In actual transactionsspecial attention needs to be paid to the fact that the trans-action performance under most transaction cost structuresis significantly lower than the trading performance withoutconsidering transaction cost It is worth noting that theperformance of traditional ML algorithm is not worse thanthat ofDNNalgorithmswithout considering transaction costwhile the performance of DNN algorithms is better than thatof traditional ML algorithms after considering transactioncost

63 Analysis of Impact of Transaction Cost on the TradingPerformance of CSICS Similar to Section 62 we will discussthe impact of transaction cost on trading performance ofCSICS in the followings In the Chinese A-share marketthe transparent transaction cost is usually set to a certain

22 Mathematical Problems in Engineering

Table26Th

eASR

ofSP

ICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

1546

815

412

15502

15764

15571

15828

13927

16237

16763

15818

16018

16298

(s0c1)

1456

214

478

14577

1300

012

317

13565

09346

13554

12650

12472

12456

11294

(s0c2)

13639

13527

13635

10191

09015

11262

04657

10822

08482

09074

08846

06236

(s0c3)

12702

12561

12679

07355

05690

08929

-00085

08061

04298

05652

05216

0118

2(s0c4)

11751

11581

11709

04511

02366

06580

-04823

05291

00139

02234

01596

-03812

(s0c5)

1079

10591

10728

01678

-00931

04227

-09500

02534

-039

59-01152

-019

87-08696

(s1c0)

15121

1505

715

149

1492

714

606

15119

1244

915

424

1558

214

825

14974

1488

6(s1c1)

14208

14116

14217

12146

11334

12841

07823

12722

1144

711459

11394

09859

(s1c2)

13279

13159

13270

09325

08020

10526

03105

09977

07267

08048

07772

04792

(s1c3)

12337

12188

12308

064

8204690

08185

-016

4607209

03082

04622

04139

-00257

(s1c4)

11382

11204

11333

03637

01368

05831

-06374

04438

-010

6801208

00524

-052

31(s1c5)

10417

10210

10348

00807

-019

2003478

-110

2501686

-05146

-02169

-0304

7-10083

(s2c0)

1477

1469

914

792

1408

113

632

1440

310

946

1460

114

390

1382

213

922

1346

2(s2c1)

13851

13752

13854

11285

10343

12111

06283

11883

10237

10439

10325

08416

(s2c2)

12916

12789

12901

08454

07021

09785

01547

09128

060

4907019

06696

03346

(s2c3)

11969

11812

11934

05607

03688

07437

-032

0506355

01868

03591

03063

-016

90(s2c4)

11010

10825

10955

02763

00372

05081

-07916

03586

-02268

00183

-00545

-06639

(s2c5)

1004

109827

09967

-0006

-02905

02729

-12533

00841

-06323

-031

79-04101

-114

54(s3c0)

14415

14337

14432

13227

12650

13679

09425

13770

13189

12810

12862

12030

(s3c1)

13490

13384

13488

10419

09348

11375

04733

11039

09023

09413

09252

06971

(s3c2)

12551

12416

12529

07580

060

19090

40-00013

08275

04832

05988

05618

01904

(s3c3)

11599

11435

11558

04731

02688

066

88-04757

05500

00658

02562

01988

-031

16(s3c4)

10636

10443

10575

01891

-00620

04331

-0944

202735

-0346

0-00836

-016

08-08034

(s3c5)

09664

09443

09584

-00924

-03883

01982

-14018

000

00-074

89-04183

-05146

-12808

(s4c0)

14058

13972

1406

812

368

11662

12950

07892

12933

11983

11793

11796

10591

(s4c1)

13127

13013

13119

09549

08350

10634

03180

10190

07807

08386

08177

05527

(s4c2)

12183

1204

12155

06705

05018

08293

-015

6807421

03617

04958

04542

004

68(s4c3)

11226

11055

11179

03857

01691

05938

-06295

046

47-00545

01537

00918

-04529

(s4c4)

1026

1006

10193

01021

-016

0703582

-10948

01888

-0464

2-018

49-02665

-09413

(s4c5)

09286

09057

09199

-017

83-04853

01238

-15478

-00836

-0864

2-05177

-06182

-14142

Mathematical Problems in Engineering 23

Table 27 The MDD of SPICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 03583 03584 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338(s0 c1) 03629 03638 03594 03779 03986 03636 04072 03712 03843 03963 03972 04203(s0 c2) 03677 03695 03647 04302 04707 03968 05168 04127 04842 04729 04787 05735(s0 c3) 03727 03756 03703 04990 05639 04376 06564 04709 06172 05682 05844 07335(s0 c4) 03781 03821 03764 05767 06612 04873 07804 05424 07377 06653 06913 08447(s0 c5) 03839 03890 03828 06529 0746 05444 08730 06162 08272 07501 07808 09118(s1 c0) 03596 03600 03560 03500 036130 03446 03574 03502 03414 03585 03569 03540(s1 c1) 03642 03655 03609 03907 04156 03717 04320 03814 04067 04154 04170 04541(s1 c2) 03691 03712 03662 04466 04936 04066 05534 04270 05172 04971 05049 06168(s1 c3) 03742 03774 03720 05183 05895 04495 06928 04885 06499 05937 06129 07662(s1 c4) 03796 03839 03781 05961 06842 05013 08105 05610 07631 06884 07161 08649(s1 c5) 03856 03909 03847 0671 07646 05595 08946 06342 08451 07691 0800 09235(s2 c0) 03609 03615 03573 03607 03756 03517 03770 03586 03586 03739 03727 03787(s2 c1) 03656 03671 03623 04047 04349 03805 04627 03929 04339 04365 04397 04929(s2 c2) 03705 03729 03678 04642 05176 04171 05916 04424 05504 05218 05327 06577(s2 c3) 03756 03792 03736 05377 06143 04624 07277 05067 06805 06183 06402 07939(s2 c4) 03812 03859 03799 06155 07056 05161 08380 05796 07856 07099 07388 08816(s2 c5) 03873 03930 03866 06887 07816 05751 09126 06517 08606 07864 08172 09331(s3 c0) 03622 03631 03588 03729 03912 03594 04004 03685 03795 03909 03909 04081(s3 c1) 03669 03687 03639 04200 04555 03901 04966 04062 04622 04587 04642 05334(s3 c2) 03719 03746 03694 04826 05423 04286 06295 04589 05833 05465 05607 06936(s3 c3) 03772 03811 03754 05572 06377 04762 07609 05248 07081 06420 06657 08175(s3 c4) 03829 03879 03818 06341 07254 05314 08620 05980 08054 07300 07593 08956(s3 c5) 03894 03954 03888 07056 07972 05909 09275 06689 08740 08022 08325 09412(s4 c0) 03635 03647 03602 03861 04082 03678 04274 03798 04015 04096 04114 04396(s4 c1) 03683 03704 03654 04362 04774 04005 05325 04211 04908 04814 04894 05730(s4 c2) 03734 03765 03712 05013 05664 04410 06667 04758 06142 05707 05875 07253(s4 c3) 03790 03833 03775 05765 06600 04905 07906 05429 07330 06644 06894 08375(s4 c4) 03851 03904 03841 06521 07439 05470 08824 06162 08230 07485 07782 09074(s4 c5) 03917 03981 03913 07218 08115 06067 09395 06857 08858 08165 08463 09480

percentage of turnover and it is the same as the assumptionin the experimental settings As in the US stock market thesmallest unit of price change is 001 (one tick) It is reasonableto set slippage to be 001-005 Of course it should be notedthat the prices fluctuation may be more intense when closingthan that in the middle of a trading day

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 28 the WR is decreasing with the increaseof transaction cost for any trading algorithm When thetransaction cost is set to (s c) = (004 0005) the WR of eachalgorithm is the smallest Comparedwith the settings withouttransaction cost the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR SVM and XGB are reduced by671 688 697 2269 1726 1548 2430 14912484 2112 2112 and 2919 respectively For a generalsetting of s and c ie (s c) = (002 0003) the WR ofMLP DBN and SAE decrease by 410 420 and 430respectively while the WR of other algorithms decrease bymore than 9 the WR of CART RF and XGB decrease by

more than 15 Therefore MLP DBN and SAE are moretolerant to transaction cost From single trading algorithmsuch as LSTM if we do not consider slippage ie s=0 theaverage WR of DBN is 05417 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage WR of LSTM is 05304 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the WR under the transactioncost structures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the WR without transaction cost for MLPDBN SAE and NB the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN SAE and NB the WR under the transaction coststructure (s0 c1) is not significantly different from the WRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

24 Mathematical Problems in Engineering

Table 28 The WR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803(s0 c1) 05523 05527 05525 05525 05608 05620 05009 05227 05612 05665 05571 05595(s0 c2) 05488 05492 05489 05389 05512 05535 04879 05149 05460 05542 05445 05411(s0 c3) 05453 05456 05452 05258 05414 05451 04747 05068 05313 05418 05320 05234(s0 c4) 05417 05419 05414 05127 05320 05368 04622 04991 05172 05297 05202 05067(s0 c5) 05383 05383 05379 05004 05230 05286 04504 04917 05036 05180 05088 04905(s1 c0) 05494 05499 05497 05444 05541 05558 04925 05170 05520 05584 05492 05488(s1 c1) 05456 05459 05456 05286 05424 05456 04775 05080 05342 05437 05345 05275(s1 c2) 05421 05423 05420 05161 05335 05377 04654 05007 05207 05320 05231 05110(s1 c3) 05386 05388 05383 05036 05246 05296 04530 04931 05065 05205 05116 04946(s1 c4) 05353 05354 05349 04915 05156 05218 04419 04861 04937 05095 05007 04795(s1 c5) 05323 05323 05317 04808 05076 05148 04315 04796 04817 04995 04905 04652(s2 c0) 05431 05434 05431 05219 05368 05403 04707 05036 05269 05374 05286 05189(s2 c1) 05395 05397 05393 05078 05266 05314 04573 04956 05115 05242 05154 05005(s2 c2) 05360 05361 05357 04960 05181 05237 04458 04886 04985 05134 05046 04853(s2 c3) 05331 05331 05326 04850 05100 05167 04352 04818 04864 05031 04945 04711(s2 c4) 05300 05300 05293 04743 05018 05093 04252 04752 04746 04931 04846 04572(s2 c5) 05273 05271 05266 04648 04946 05029 04159 04692 04639 04838 04755 04445(s3 c0) 05373 05374 05371 05019 05216 05265 04514 04917 05049 05186 05098 04932(s3 c1) 05341 05341 05336 04902 05128 05188 04399 04846 04917 05074 04990 04775(s3 c2) 05312 05312 05306 04798 05052 05122 04303 04782 04804 04977 04896 04644(s3 c3) 05281 05281 05275 04696 04976 05049 04206 04718 04689 04879 04799 04509(s3 c4) 05252 05251 05245 04598 04901 04984 04110 04657 04581 04785 04707 04378(s3 c5) 05226 05223 05218 04510 04833 04924 04023 04602 04481 04701 04621 04264(s4 c0) 05325 05325 05321 04860 05089 05150 04360 04816 04870 05030 04949 04723(s4 c1) 05294 05294 05289 04753 05010 05079 04258 04750 04752 04928 04849 04588(s4 c2) 05266 05265 05259 04653 04937 05013 04164 04690 04642 04838 04761 04458(s4 c3) 05238 05236 05230 04562 04864 04948 04073 04632 04541 04747 04672 04336(s4 c4) 05211 05208 05203 04475 04798 04891 03985 04577 04440 04662 04586 04218(s4 c5) 05186 05182 05176 04392 04733 04832 03901 04524 04348 04582 04509 04109

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 29 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the smallest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 5073 5175 and 5225 respectivelyWhile the ARR of other trading algorithms decrease bymore than 100 compared with those algorithms withouttransaction cost Therefore excessive transaction cost canlead to serious losses in the accounts For a general settingof s and c ie (s c) = (002 0003) ARR of MLP DBNand SAE decrease by 2741 2797 and 2825 respectivelywhile the ARR other algorithms decrease by more than 50and that of CART NB RF and XGB decrease by more than100 Therefore MLP DBN and SAE are more tolerant totransaction cost From single trading algorithm such as SAEif we do not consider slippage ie s=0 the average ARR ofSAE is 05040 under the transaction cost structure (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not consider

transparent transaction cost ie c=0 the averageARRof SAEis 04468 under the transaction cost structures (s1 c0) (s2c0) (s3 c0) (s4 c0) so transparent transaction cost hassmaller impact than slippage Through multiple comparativeanalysis the ARR under the transaction cost structures (s0c1) (s0 c2) (s0 c3) (s0 c1) (s1 c1) are not significantlydifferent from the ARR without transaction cost for MLPDBN and SAE the ARR under all other transaction coststructures are significantly smaller than the ARR withouttransaction cost For RNN LSTM GRU CART RF LR andSVM the ARR under the transaction cost structures (s0c1) (s0 c2) (s1 c0) are not significantly different fromthe ARR without transaction cost the ARR under all othertransaction cost structures are significantly smaller than theARR without transaction cost For NB and XGB the ARRunder the transaction cost structures (s0 c1) (s1 c0) arenot significantly different from the ARR without transactioncost the ARR under all other transaction cost structuresare significantly smaller than the ARR without transactioncost

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 7: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

Mathematical Problems in Engineering 7

Input TS TS is trading signals of a stockOutput AR PR RR F1 AUC WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) Bt=Benchmark Index [ldquoClosing Pricerdquo] B is the closing price of benchmark index(3) WR=NULL ARR=NULL ASR=NULL MDD=NULL(4) for (i in 1 N) (5) Stock Data=Stock Code List[i](6) Pt=Stock Data [ldquoClosing Pricerdquo](7) Labelt= Stock Data [ldquoLabelrdquo](8) BDRRt=(Bt-Bt-1) Bt-1 BDRR is the daily return rate of benchmark index(9) DRRt= (Pt-Pt-1)Pt-1 DRR is daily return rateThat is daily return rate of BAH strategy(10) TDRRt=lag (TSt)lowastDRRt TDRR is the daily return through trading(11) Table=Confusion Matrix(TS Label)(12) AR[i]=sum(adj(Table))sum(Table)(13) PR[i]=Table[2 2]sum(Table[ 2])(14) RR[i]=Table[2 2]sum(Table[2 ])(15) F1=2lowastPR[i]lowastRR[i](PR[i]+RR[i])(16) Pred=prediction (TS Label)(17) AUC[i]=performance (Pred measure=ldquoaucrdquo)yvalues[[1]](18) WR[i]=sum (TDRRgt0)sum(TDRR =0)(19) ARR[i]=Returnannualized (TDRR) TDRR BDRR or DRR can be used(20) ASR[i]=SharpeRatioannualized (TDRR) TDRR BDRR or DRR can be used(21) MDD[i]=maxDrawDown (TDRR) TDRR BDRR or DRR can be used(22) AR=c (AR AR[i])(23) PR=c (PR PR[i])(24) RR=c (RR RR[i])(25) F1=c (F1 F1[i])(26) AUC=c (AUC AUC[i])(27) WR=c (WR WR[i])(28) ARR=c (ARR ARR[i])(29) ASR=c (ASR ASR[i])(30) MDD=c (MDD MDD[i])(31) (32) Performance=cbind (AR PR RR F1 AUC WR ARR ASR MDD)(33) return (Performance)

Algorithm 2 Backtesting algorithm of daily trading strategy in R language

Table 4 Trading performance of different trading strategies in the SPICS Best performance of all trading strategies is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGBAR mdash mdash 05205 05189 05201 05025 05013 04986 06309 05476 06431 06491 06235 06600PR mdash mdash 07861 07764 07781 05427 05121 04911 06514 05270 06595 06474 06733 06738RR mdash mdash 05274 05263 05273 05245 05253 05239 06472 05762 06599 06722 06325 06767F1 mdash mdash 06258 06217 06229 05332 05183 05065 06491 05480 06595 06591 06517 06751AUC mdash mdash 05003 05001 05002 04997 05005 04992 06295 05489 06418 06491 06199 06590WR 05450 05235 05676 05680 05683 05843 05825 05844 05266 05930 05912 05859 05831 05891ARR 01227 01603 03333 03298 03327 02945 02921 02935 03319 02976 03134 02944 03068 03042ASR 08375 06553 15472 15415 15506 15768 15575 15832 13931 16241 16768 15822 16022 16302MDD 01939 04233 03584 03585 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338

various trading algorithms in AR PR RR F1 AUC WRARR ASR and MDD We can see that the AR RR F1 andAUC of XGB are the greatest in all trading algorithms TheWR of NB is the greatest in all trading strategies The ARRof MLP is the greatest in all trading strategies including thebenchmark index (SampP 500 index) and BAH strategy TheASR of RF is the greatest in all trading strategies TheMDDofthe benchmark index is the smallest in all trading strategies

It is worth noting that the ARR and ASR of all ML algorithmsare greater than those of BAH strategy and the benchmarkindex

(1) Through the hypothesis test analysis of H1a and H1bwe can obtain p valuelt22e-16

Therefore there are statistically significant differencesbetween the AR of all trading algorithms Therefore we needto make multiple comparative analysis further as shown in

8 Mathematical Problems in Engineering

Table 5Multiple comparison analysis between theAR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 10000GRU 00000 00000 00000 08273 09811CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00232 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 07649SVM 00000 00000 00000 00000 00000 00000 06057 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00002 02010 00000

Table 6Multiple comparison analysis between the PR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 09999SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00034GRU 00000 00000 00000 00000 01472CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 07869 05786 00000 00000RF 00000 00000 00000 00000 00000 00000 08056 00000LR 00000 00000 00000 00000 00000 00000 09997 00000 02626SVM 00000 00000 00000 00000 00000 00000 00008 00000 03104 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00491 00000 09999

Table 5 The number in the table is a p value of any two algo-rithms of Nemenyi test When p valuelt005 we think thatthe two trading algorithms have a significant differenceotherwise we cannot deny the null assumption that the meanvalues of AR of the two algorithms are equal From Tables 5and 4 we can see that the AR of all DNN models are signif-icantly lower than those of all traditional MLmodelsTheARof MLP DBN and SAE are significantly greater than those ofRNN LSTM and GRU There are no significant differencesamong the AR of MLP DBN and SAE There are no sig-nificant differences among the AR of RNN LSTM and GRU

(2) Through the hypothesis test analysis of H2a and H2bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between the PR of all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 6 The number in the table is a pvalue of any two algorithms of Nemenyi test From Tables 6and 4 we can see that the PR of MLP DBN and SAE aresignificantly greater than that of other trading algorithmsThe PR of LSTM is not significantly different from that ofGRU and NBThe PR of GRU is significantly lower than thatof all traditional ML algorithms The PR of NB is significantlylower than that of other traditional ML algorithms

(3) Through the hypothesis test analysis of H3a and H3bwe can obtain p valuelt22e-16 So there are statistically

significant differences between the RR of all trading algo-rithms Therefore we need to make multiple comparativeanalysis further as shown in Table 7 The number in thetable is a p value of any two algorithms of Nemenyi testFrom Tables 7 and 4 we can see that there is no significantdifference among the RR of all DNN models but the RRof any DNN model is significantly lower than that of alltraditional ML models The RR of NB is significantly lowerthan that of other traditional ML algorithms The RR ofCART is significantly lower than that of other traditional MLalgorithms except for NB

(4) Through the hypothesis test analysis of H4a and H4bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between the F1 of all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 8 The number in the table is a pvalue of any two algorithms of Nemenyi test From Tables8 and 4 we can see that there is no significant differenceamong the F1 of MLP DBN and SAE The F1 of MLP DBNand SAE are significantly greater than that of RNN LSTMGRU andNB but are significantly smaller than that of RF LRSVM and XGBThe F1 of GRU and LSTMhave no significantdifference but they are significantly smaller than that of alltraditional ML algorithms The F1 of XGB is significantlygreater than that of all other trading algorithms

Mathematical Problems in Engineering 9

Table 7Multiple comparison analysis between the RR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 10000 10000 10000LSTM 10000 10000 10000 10000GRU 09999 10000 09999 10000 10000CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00485 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 00555SVM 00000 00000 00000 00000 00000 00000 00197 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00010 09958 00000

Table 8Multiple comparison analysis between the F1 of any two trading algorithms The p value of the two trading strategies with significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 09998SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00810GRU 00000 00000 00000 00000 03489CART 00861 00061 00117 00000 00000 00000NB 00000 00000 00000 04635 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00078 00000LR 00000 00000 00000 00000 00000 00000 00173 00000 10000SVM 00007 00000 00000 00000 00000 00000 09797 00000 03336 04825XGB 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000

Table 9 Multiple comparison analysis between the AUC of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 10000 10000 10000LSTM 10000 10000 10000 09999GRU 10000 10000 10000 10000 09975CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00270 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 05428SVM 00000 00000 00000 00000 00000 00000 03125 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00002 03954 00000

(5) Through the hypothesis test analysis of H5a and H5bwe can obtain p valuelt22e-16 So there are statisticallysignificant differences between the AUC of all trading algo-rithms Therefore we need to make multiple comparativeanalysis further as shown in Table 9 The number in thetable is a p value of any two algorithms of Nemenyi testFrom Tables 9 and 4 we can see that there is no significantdifference among the AUC of all DNN models The AUC of

all DNN models are significantly smaller than that of anytraditional ML model

(6) Through the hypothesis test analysis of H6a and H6bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between theWRof all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 10 The number in the table is pvalue of any two algorithms of Nemenyi test From Tables 4

10 Mathematical Problems in Engineering

Table10M

ultip

lecomparis

onanalysisbetweentheW

Rof

anytwotradingalgorithm

sTh

epvalueo

fthe

twotradingstr

ategiesw

ithsig

nificantd

ifference

isin

boldface

Index

BAH

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

BAH

000

00MLP

000

00000

00DBN

000

00000

0010

000

SAE

000

00000

0010

000

1000

0RN

N000

00000

00000

00000

00000

00LSTM

000

00000

00000

00000

00000

0009974

GRU

000

11000

00000

01000

00000

0010

000

09961

CART

000

0009998

000

00000

00000

00000

00000

00000

00NB

000

00000

00000

00000

00000

00000

31000

00000

38000

00RF

000

00000

00000

00000

00000

0000118

000

0100140

000

0010

000

LR000

00000

00000

00000

00000

0010

000

08508

1000

0000

00004

320117

7SV

M000

00000

00000

00000

00000

0010

000

1000

010

000

000

00000

01000

0609780

XGB

000

00000

00000

00000

00000

0002660

000

8402927

000

0009831

09989

07627

00376

Mathematical Problems in Engineering 11

Table 11Multiple comparison analysis between theARRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00001 00006 00001LSTM 00000 00000 00000 00002 00000 10000GRU 00000 00000 00001 00008 00001 10000 10000CART 00000 00000 10000 10000 10000 00001 00000 00001NB 00000 00000 00021 00094 00022 10000 09998 10000 00018RF 00000 00000 07978 09524 08036 01685 00874 01962 07745 05861LR 00000 00000 00002 00012 00002 10000 10000 10000 00002 10000 02408SVM 00000 00000 02375 04806 02427 07029 05214 07457 02178 09778 09999 08015XGB 00000 00000 00674 01856 00694 09423 08466 09576 00600 09996 09905 09739 10000

Table 12Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 09667MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 08763 07617 08998LSTM 00000 00000 09922 09701 09949 10000GRU 00000 00000 06124 04563 06537 10000 09996CART 00000 00000 00002 00005 00002 00000 00000 00000NB 00000 00000 00467 00233 00557 09529 07037 09971 00000RF 00000 00000 00000 00000 00000 00291 00042 01062 00000 08010LR 00000 00000 07506 06025 07859 10000 10000 10000 00000 09872 00602SVM 00000 00000 01759 01020 02010 09982 09399 10000 00000 10000 04671 09998XGB 00000 00000 00099 00044 00122 07548 03776 09470 00000 10000 09681 08791 09997

and 10 we can see that the WR of MLP DBN and SAE haveno significant difference but they are significantly higherthan that of BAH and benchmark index and significantlylower than that of other trading algorithms TheWR of RNNLSTM and GRU have no significant difference but they aresignificantly higher than that of CART and significantly lowerthan that of NB and RF The WR of LR is not significantlydifferent from that of RF SVM and XGB

(7) Through the analysis of the hypothesis test of H7aand H7b we obtain p valuelt22e-16 Therefore there aresignificant differences between the ARR of all trading strate-gies including the benchmark index and BAH We needto do further multiple comparative analysis as shown inTable 11 From Tables 4 and 11 we can see that the ARR ofthe benchmark index and BAH are significantly lower thanthat of all ML algorithms The ARR of MLP DBN and SAEare significantly greater than that of RNN LSTM GRU NBand LR but not significantly different from that of CARTRF SVM and XGB there is no significant difference betweenthe ARR of MLP DBN and SAE The ARR of RNN LSTM

and GRU are significantly less than that of CART but theyare not significantly different from that of other traditionalML algorithms In all traditional ML algorithms the ARR ofCART is significantly greater than that of NB and LR butotherwise there is no significant difference between ARR ofany other two algorithms

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore there are significantdifferences between ASR of all trading strategies includingthe benchmark index and BAH The results of our multiplecomparative analysis are shown in Table 12 From Tables 4and 12 we can see that the ASR of the benchmark index andBAH are significantly smaller than that of all ML algorithmsThe ASR of MLP and DBN are significantly greater than thatof CART and are significantly smaller than that of NB RFand XGB but there is no significant difference between MLPDBN and other algorithms The ASR of SAE is significantlygreater than that of CART and significantly less than that ofRF and XGB but there is no significant difference betweenSAE and other algorithms The ASR of RNN and LSTM

12 Mathematical Problems in Engineering

Table 13 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00052DBN 00000 00031 10000SAE 00000 00012 10000 10000RNN 00000 00000 01645 02243 03556LSTM 00000 00000 06236 07173 08511 10000GRU 00000 00000 00245 00381 00760 10000 09860CART 00000 00000 01496 02057 03309 10000 10000 10000NB 00000 00000 00786 01136 01999 10000 09994 10000 10000RF 00000 00000 00002 00004 00012 08964 04248 09980 09109 09713LR 00000 00000 05451 06428 07935 10000 10000 09933 10000 09998 05015SVM 00000 00000 02433 03194 04734 10000 10000 09999 10000 10000 08155 10000XGB 00000 00000 00103 00167 00360 09998 09462 10000 09999 10000 09998 09685 09989

Table 14 Trading performance of different trading strategies in CSICS Best performance of all trading strategies is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGBAR mdash mdash 05175 05167 05163 05030 04993 04993 05052 05084 05090 05084 05112 05087PR mdash mdash 07548 07436 07439 05414 04964 04956 05022 05109 05128 04967 05695 05026RR mdash mdash 05252 05250 05248 05234 05224 05223 05279 05307 05311 05318 05295 05315F1 mdash mdash 06150 06108 06108 05320 05086 05082 05143 05192 05214 05132 05483 05164AUC mdash mdash 05027 05024 05020 05006 04995 04996 05049 05078 05082 05086 05074 05085WR 05222 05090 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803ARR 00633 02224 05731 05704 05678 05248 05165 05113 05534 06125 04842 05095 05004 04938ASR 02625 04612 14031 14006 13935 14880 15422 15505 12232 11122 14379 15582 14231 14698MDD 04808 06697 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632

are significantly greater than that of CART and significantlyless than that of RF but there is no significant differencebetweenRNN LSTM and other algorithmsTheASRofGRUis significantly greater than that of CART but there is nosignificant difference between GRU and other traditional MLalgorithms In all traditional ML algorithms the ASR of allalgorithms are significantly greater than that of CART butotherwise there is no significant difference between ASR ofany other two algorithms

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between MDD of trading strategies includingthe benchmark index and the BAH The results of multiplecomparative analysis are shown in Table 13 From Tables4 and 13 we can see that MDD of any ML algorithm issignificantly greater than that of the benchmark index butsignificantly smaller than that of BAH strategy The MDDof MLP and DBN are significantly smaller than those ofGRU RF and XGB but there is no significant differencebetween MLP DBN and other algorithms The MDD ofSAE is significantly smaller than that of XGB but there isno significant difference between SAE and other algorithmsOtherwise there is no significant difference betweenMDDofany other two algorithms

In a word the traditional ML algorithms such as NBRF and XGB have good performance in most directional

evaluation indicators such as AR PR and F1 The DNNalgorithms such as MLP have good performance in PR andARR In traditional ML algorithms the ARR of CART RFSVM and XGB are not significantly different from that ofMLP DBN and SAE the ARR of CART is significantlygreater than that of LSTM GRU and RNN but otherwisethe ARR of all traditional ML algorithms are not significantlyworse than that of LSTM GRU and RNN The ASR of alltraditional ML algorithms except CART are not significantlyworse than that of the six DNNmodels even the ASR of NBRF and XGB are significantly greater than that of some DNNalgorithms The MDD of RF and XGB are significantly lessthat of MLP DBN and SAE the MDD of all traditional MLalgorithms are not significantly different from that of LSTMGRU and RNNThe ARR and ASR of all ML algorithms aresignificantly greater than that of BAH and the benchmarkindex the MDD of any ML algorithm is significantly greaterthan that of the benchmark index but significantly less thanthat of BAH strategy

53 Comparative Analysis of Performance of Different TradingStrategies in CSICS The analysis methods of this part aresimilar to Section 52 From Table 14 we can see that the ARPR and F1 of MLP are the greatest in all trading algorithmsThe RR AUC WR and ASR of LR are the greatest inall trading algorithms respectively The ARR of NB is the

Mathematical Problems in Engineering 13

Table 15Multiple comparison analysis between theARof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 01857GRU 00000 00000 00000 04439 10000CART 00000 00000 00000 09765 00024 00131NB 00000 00001 00002 00022 00000 00000 01810RF 00000 00002 00005 00007 00000 00000 00941 10000LR 00000 00000 00000 00076 00000 00000 03454 10000 10000SVM 00217 00766 01309 00000 00000 00000 00003 08314 09352 06360XGB 00000 00001 00001 00025 00000 00000 01930 10000 10000 10000 08168

Table 16Multiple comparison analysis between the PRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 09906 09781NB 00000 00000 00000 00000 01716 01234 08940RF 00000 00000 00000 00000 00319 00205 05271 10000LR 00000 00000 00000 00000 10000 10000 09951 02099 00422SVM 00000 00000 00000 01157 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00000 09922 09811 10000 08836 05086 09960 00000

highest in all trading strategies The MDD of CSI 300 index(benchmark index) is the smallest in all trading strategiesTheWRARR and ASR of all ML algorithms are greater thanthose of the benchmark index and BAH strategy

(1) Through the hypothesis test analysis of H1a and H1bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the AR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 15The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 15 we can see that the AR ofMLPDBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms except for SVM The ARof GRU is significantly smaller than that of all traditional MLalgorithms There is no significant difference between the ARof any two traditional ML algorithms except for CART andSVM

(2) Through the hypothesis test analysis of H2a and H2bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the PR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 16 The number in the tableis a p value of any two algorithms of Nemenyi test FromTables 14 and 16 we can see that the PR of MLP DBN and

SAE are significantly greater than that of all other tradingalgorithms and the PR of MLP DBN and SAE have nosignificant difference The PR of SVM is significantly greaterthan that of all other traditional ML algorithms which haveno significant difference between any two algorithms exceptfor SVM The PR of RNN is significantly greater than thatof all traditional ML algorithms except for SVM The PR ofGRU and LSTM are not significantly different from that of alltraditional ML algorithms except for SVM and LR

(3) Through the hypothesis test analysis of H3a and H3bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the RR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 17 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 17 we can see that the RR of all DNN models arenot significantly different There is no significant differenceamong the RR of all traditional ML algorithms The RR ofRNN GRU and LSTM are significantly smaller than that ofany traditional ML algorithm except for CART

(4) Through the hypothesis test analysis of H4a and H4bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the F1 of all trading algorithms There-fore we need to do further multiple comparative analysis and

14 Mathematical Problems in Engineering

Table 17Multiple comparison analysis between the RRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 09996 09996 10000LSTM 09309 09314 09781 09999GRU 09660 09663 09916 10000 10000CART 09744 09742 09225 05809 01509 02138NB 01093 01088 00574 00075 00004 00007 08861RF 00537 00534 00260 00028 00001 00002 07544 10000LR 00330 00328 00152 00015 00001 00001 06498 10000 10000SVM 03444 03434 02170 00434 00033 00059 09920 10000 09998 09991XGB 00193 00192 00085 00007 00000 00000 05344 10000 10000 10000 09960

Table 18 Multiple comparison analysis between the F1 of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 07211 06670NB 00000 00000 00000 00136 00132 00099 08664RF 00000 00000 00000 00786 00016 00011 05162 10000LR 00000 00000 00000 00000 09440 09208 10000 05675 02181SVM 00000 00000 00000 00178 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00001 03138 02679 10000 09937 08849 09964 00000

Table 19 Multiple comparison analysis between the AUC of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 09999 10000RNN 09945 09985 10000LSTM 05273 06382 09259 09937GRU 08448 09102 09958 10000 10000CART 06921 05835 02356 00801 00014 00096NB 00002 00001 00000 00000 00000 00000 02616RF 00001 00001 00000 00000 00000 00000 02002 10000LR 00000 00000 00000 00000 00000 00000 00930 10000 10000SVM 00027 00014 00001 00000 00000 00000 06454 10000 09999 09980XGB 00000 00000 00000 00000 00000 00000 01257 10000 10000 10000 09993

the results are shown in Table 18The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 18 we can see that the F1 of MLP DBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms There is no significantdifference among traditionalML algorithms except SVM andthe F1 of SVM is significantly greater than that of all othertraditional ML algorithms

(5) Through the hypothesis test analysis of H5a and H5bwe can obtain p valuelt22e-16Therefore there are significantdifferences between theAUCof all trading algorithmsThere-fore we need to do further multiple comparative analysis andthe results are shown in Table 19 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 19 we can see that the AUC of all DNN models haveno significant difference There is no significant difference

Mathematical Problems in Engineering 15

Table 20 Multiple comparison analysis between the WR of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 04117MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00002 00006 00000LSTM 00000 00000 00000 00000 00000 09772GRU 00000 00000 00000 00000 00000 09911 10000CART 09931 00000 00000 00000 00000 00000 00000 00000NB 00031 00000 00001 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00205 06437 05358 00000 00000LR 00000 00000 00000 00000 00000 00010 01611 01105 00000 00000 10000SVM 00000 00000 00000 00000 00000 09914 10000 10000 00000 00000 05322 01090XGB 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000

Table 21Multiple comparison analysis between theARRof any two trading strategiesThepvalue of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00007MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 04790 06355 07182LSTM 00000 00000 02512 03806 04630 10000GRU 00000 00000 02235 03454 04249 10000 10000CART 00000 00000 08301 09217 09542 10000 09999 09998NB 00000 00000 10000 10000 10000 02920 01295 01125 06517RF 00000 00000 00020 00048 00076 08705 09735 09806 05393 00006LR 00000 00000 02058 03222 03995 10000 10000 10000 09996 01019 09845SVM 00000 00000 10000 00803 01114 09993 10000 10000 09659 00165 09999 10000XGB 00000 00000 10000 00333 00484 09916 09997 09998 08789 00057 10000 09999 10000

between the AUC of all traditional ML algorithms TheAUC of all traditional ML algorithms except for CART aresignificantly greater than that of any DNN model There isno significant difference among the AUC ofMLP SAE DBNRNN and CART

(6)Through the hypothesis test analysis of H6a and H6bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the WR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 20 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 20 we can see that the WR of BAH and benchmarkindex have no significant difference but they are significantlysmaller than that of anyML algorithmTheWRofMLPDBNand SAE are significantly smaller than that of the other trad-ing algorithms but there is no significant difference betweenthe WR of MLP DBN and SAE The WR of LSTM andGRU have no significant difference but they are significantlysmaller than that of XGB and significantly greater than that of

CART and NB In traditional MLmodels the WR of NB andCART are significantly smaller than that of other algorithmsThe WR of XGB is significantly greater than that of all otherML algorithms

(7)Through the analysis of the hypothesis test of H7a andH7b we obtain p valuelt22e-16

Therefore there are significant differences between theARR of all trading strategies including the benchmark indexand BAH strategy Therefore we need to do further multiplecomparative analysis and the results are shown in Table 21FromTables 14 and 21 we can see that ARR of the benchmarkindex and BAH are significantly smaller than that of alltrading algorithms The ARR of MLP is significantly higherthan that of RF but there is no significant difference betweenMLP and other algorithms The ARR of SAE and DBN aresignificantly higher than that of RF and XGB but they arenot significantly different fromARR of other algorithms TheARR of NB is significantly higher than that of RF SVMand XGB But otherwise there is no significant difference

16 Mathematical Problems in Engineering

Table 22Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 08877MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 09099 08862 08114LSTM 00000 00000 03460 03080 02239 09999GRU 00000 00000 02132 01853 01270 09981 10000CART 00000 00000 00158 00195 00327 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000 00000 07298RF 00000 00000 10000 10000 10000 09968 07444 05789 00018 00000LR 00000 00000 01181 01003 00650 09879 10000 10000 00000 00000 04044SVM 00000 00000 10000 10000 10000 09849 05952 04238 00042 00000 10000 02704XGB 00000 00000 09937 09902 09746 10000 09878 09532 00001 00000 10000 08723 09998

Table 23 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00006DBN 00000 00004 10000SAE 00000 00023 10000 10000RNN 00000 00000 00320 00421 00111LSTM 00000 00000 00002 00003 00000 09947GRU 00000 00000 00001 00001 00000 09767 10000CART 00000 00000 01238 01538 00521 10000 09241 08305NB 00000 01875 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 01180 01469 00493 10000 09298 08401 10000 00000LR 00000 00000 00001 00002 00000 09881 10000 10000 08821 00000 08898SVM 00000 00000 03285 03839 01701 09999 07011 05424 10000 00000 10000 06216XGB 00000 00000 00308 00405 00106 10000 09951 09783 10000 00000 10000 09890 09998

between any other two algorithms Therefore the ARR ofmost traditional ML models are not significantly worse thanthat of the best DNNmodel

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore There are significantdifferences betweenASRof all trading strategies including thebenchmark index and BAH strategy The results of multiplecomparative analysis are shown in Table 22 From Tables 14and 22 we can see that the ASR of the benchmark indexand BAH are significantly smaller than that of all tradingalgorithms The ASR of all ML algorithms are significantlyhigher than that of CART and NB but there is no significantdifference between the ASR of CART and NB Beyond thatthere is no significant difference between any other twoalgorithms Therefore the ASR of all traditional ML modelsexcept NB and CART are not significantly worse than that ofany DNNmodel

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between the MDD of these trading strategies

including the benchmark index and the BAH strategyThe results of multiple comparative analysis are shown inTable 23 From Tables 14 and 23 we can see that the MDDof the benchmark index is significantly smaller than that ofother trading strategies including BAH strategy TheMDD ofBAH is significantly greater than that of all trading algorithmsexcept NBTheMDDofMLPDBN and SAE are significantlylower than that of NB but significantly higher than thatof RNN LSTM GRU LR and XGB The MDD of NB issignificantly greater than that of all other trading algorithmsBeyond that there is no significant difference between anyother two algorithms Therefore all ML algorithms expectNB especially LSTM RNN GRU LR and XGB can play arole in controlling trading risk

In a word some DNN models such as MLP DBN andSAE have good performance in AR PR and F1 traditionalML algorithms such as LR and XGB have good performanceinAUCandWRTheARRof some traditionalML algorithmssuch as CART NB LR and SVM are not significantlydifferent from that of the six DNN models The ASR of the

Mathematical Problems in Engineering 17

six DNN algorithms are not significantly different from alltraditional ML models except NB and CART The MDD ofLR and XGB are significantly smaller than those of MLPDBN and SAE and are not significantly different fromthat of LSTM GRU and RNN The ARR and ASR of allML algorithms are significantly greater than those of BAHand benchmark index the MDD of all ML algorithms aresignificantly smaller than that of the benchmark index butsignificantly greater than that of BAH strategy

From the above analysis and evaluation we can see thatthe directional evaluation indicators of some DNN modelsare very competitive in CSICS while the indicators of sometraditional ML algorithms have excellent performance inSPICS Whether in SPICS or CSICS the ARR and ASR ofall ML algorithms are significantly greater than that of thebenchmark index and BAH strategy respectively In all MLalgorithms there are always some traditional ML algorithmswhich are not significantly worse than the best DNN modelfor any performance evaluation indicator (ARR ASR andMDD)Therefore if we do not consider transaction cost andother factors affecting trading performance of DNN modelsare alternative but not the best choice when they are appliedto stock trading

In the same period the ARR of any ML algorithm inCSICS is significantly greater than that of the same algorithmin SPICS (p valuelt0001 in theNemenyi test)Meanwhile theMDD of any ML algorithm in CSICS is significantly greaterthan that of the same algorithm in SPICS (p value lt0001in the Nemenyi test) The results show that the quantitativetrading algorithms can more easily obtain excess returns inthe Chinese A-share market but the volatility risk of tradingin Chinese A-share market is significantly higher than that ofthe US stock market in the past 8 years

6 The Impact of Transaction Cost onPerformance of ML Algorithms

Trading cost can affect the profitability of a stock tradingstrategy Transaction cost that can be ignored in long-termstrategies is significantly magnified in daily trading Howevermany algorithmic trading studies assume that transactioncost does not exist ([10 17] etc) In practice frictions suchas transaction cost can distort the market from the perfectmodel in textbooks The cost known prior to trading activityis referred to as transparent such as commissions exchangefees and taxes The costs that has to be estimated are knownas implicit including comprise bid-ask spread latency orslippage and related market impact This section focuses onthe transparent and implicit cost and how do they affecttrading performance in daily trading

61 Experimental Settings and Backtesting Algorithm In thispart the transparent transaction cost is calculated by a certainpercentage of transaction turnover for convenience theimplicit transaction cost is very complicated in calculationand it is necessary to make a reasonable estimate for therandom changes of market environment and stock pricesTherefore we only discuss the impact of slippage on tradingperformance

The transaction cost structures of American stocks aresimilar to that of Chinese A-shares We assume that transpar-ent transaction cost is calculated by a percentage of turnoversuch as less than 05 [40 41] and 02 and 05 in theliterature [42] It is different for the estimation of slippage

In some quantitative trading simulation software such asJoinQuant [43] and Abuquant [44] the slippage is set to 002The transparent transaction cost and implicit transaction costare charged in both directions when buying and selling Itis worth noting that the transparent transaction cost varieswith the different brokers while the implicit transaction costis related to market liquidity market information networkstatus trading software etc

We set slippages s = s0=0 s1=001 s2=002 s3=003s4=004 the transparent transaction cost c = c0=0 c1=0001c2=0002 c3=0003 c4=0004 c5=0005 For different s ccombinations we study the impact of different transactioncost structures on trading performance We assume thatbuying and selling positions are one unit so the turnover isthe corresponding stock price When buying stocks we notonly need to pay a certain percentage cost of the purchaseprice but also need to pay an uncertain slippage cost Thatis we need to pay a higher price than the real-time price119875119905minus1

when we are buying But when selling stocks we notonly need to pay a certain percentage cost of the sellingprice but also to pay an uncertain slippage cost Generallyspeaking we need to sell at a price lower than the real-timeprice 119875

119905 It is worth noting that our trading strategy is self-

financing If ML algorithms predict the continuous occur-rence of buying signals or selling signals ie |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 0 we will continue to hold or do nothingso the transaction cost at this time is 0 when |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 1 it is indicated that the position maybe changed from holding to selling or from empty positionto buying At this time we would pay transaction costdue to the trading operation Finally we get a real yieldis

119877119890119905119905le119862119897119900119904119890119875119903119894119888119890

119905minus 119862119897119900119904119890119875119903119894119888119890

119905minus1

119862119897119900119904119890119875119903119894119888119890119905minus1

119875119905= 119862119897119900119904119890119875119903119894119888119890

119905

lowast (1 minus 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816)

minus 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816

119875119905minus1

= 119862119897119900119904119890119875119903119894119888119890119905minus1

lowast (1 + 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816)

+ 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816

119877119890119905119905=119875119905minus 119875119905minus1

119875119905minus1

(5)

where 119862119897119900119904119890119875119903119894119888119890119905

denotes the 119905-th closing price119879119903119886119889119890119878119894119892119899119886119897

119905denotes the 119905-th trading signal 119875

119905denotes

the 119905-th executing price and 119877119890119905119905denotes the 119905-th return rate

We propose a backtesting algorithm with transaction costbased on the above analysis as is shown in Algorithm 3

18 Mathematical Problems in Engineering

Input TS TS is trading signals of a stocks s is slippagec c is transparent transaction cost

Output WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) WR=NULL ARR=NULL ASR=NULL MDD=NULL(3) for (i in 1 N) (4) Stock Data=Stock Code List[i](5) ClosePricet=Stock Data [ldquoClosing Pricerdquo](6) Pt =ClosePricet lowast(1-clowastabs(TSt-TSt-1)) - slowastabs(TSt-TSt-1)(7) Pt-1 =ClosePricetlowast(1+clowastabs(TSt-TSt-1)) + slowastabs(TSt-TSt-1)(8) Rett= (Pt- Pt-1) Pt Ret is the return rate series(9) TDRR=lag (TS)lowastRet TDRR is the daily return through trading(10) WR[i]=sum (TDRRgt0)sum(TDRR =0)(11) ARR[i]=Returnannualized (TDRR)(12) ASR[i]=SharpeRatioannualized (TDRR)(13) MDD[i]=maxDrawDown (TDRR)(14) WR=c (WR WR[i])(15) ARR=c (ARR ARR[i])(16) ASR=c (ASR ASR[i])(17) MDD=c (MDD MDD[i])(18) (19) return (WR ARR ASR MDD)

Algorithm 3 Backtesting algorithm with transaction cost in R language

62 Analysis of Impact of Transaction Cost on the TradingPerformance of SPICS Transaction cost is one of the mostimportant factors affecting trading performance In US stocktrading transparent transaction cost can be charged accord-ing to a fixed fee per order or month or a floating fee basedon the volume and turnover of each transaction Sometimescustomers can also negotiate with broker to determinetransaction cost The transaction cost charged by differentbrokers varies greatly Meanwhile implicit transaction costis not known beforehand and the estimations of them arevery complex Therefore we assume that the percentageof turnover is the transparent transaction cost for ease ofcalculation In the aspect of implicit transaction cost we onlyconsider the impact of slippage on trading performance

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 24 WR is decreasing with the increase oftransaction cost for any trading algorithm which is intuitiveWhen the transaction cost is set to (s c) = (004 0005) theWR of each algorithm is the lowest Compared with setting(s c) = (0 0) the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR and SVM to XGB are reduced by580 597 591 1583 1804 1395 2171 16042216 1854 1850 and 2597 respectively ThereforeMLP DBN and SAE are more tolerant to transaction costGenerally speaking the DNN models have stronger capacityto accommodate transaction cost than the traditional MLmodels From the single trading algorithm such as MLP ifwe do not consider slippage ie s=0 the average WR ofMLP is 05510 under transaction cost structures (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not considertransparent transaction cost ie c=0 the averageWRofMLP

is 05618 under transaction cost structures (s1 c0) (s2 c0)(s3 c0) (s4 c0) so transparent transaction cost has greaterimpact than slippageThroughmultiple comparative analysisthe WR under the transaction cost structure (s1 c0) is notsignificantly different from the WR without transaction costfor MLP DBN and SAETheWR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the WR under the transaction cost structure (s1 c0) (s2 c0) are not significantly different from theWRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 25 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the lowest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 4031 4157 and 4093 respectivelywhile the ARR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin accounts For a general setting of s and c ie (s c) = (0020003) ARR of MLP DBN and SAE decrease by 23262400 and 2361 respectively while the ARR of otheralgorithms decrease by more than 50 and that of CARTand XGB decrease bymore than 100ThereforeMLP DBNand SAE are more tolerant to high transaction cost Fromsingle trading algorithm such as RNN if we do not considerslippage ie s=0 the average ARR of RNN is 01434 under

Mathematical Problems in Engineering 19

Table24Th

eWRof

SPICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

05676

05680

05683

05843

05825

05844

05266

05930

05912

05859

05831

05891

(s0c1)

05615

05618

05621

05669

05626

05694

05052

05752

05663

05654

05630

05599

(s0c2)

05560

05560

05564

05507

05442

05553

04847

05585

05429

05463

05438

05324

(s0c3)

05507

05506

05510

05353

05269

05418

04652

05424

05205

05278

05253

05061

(s0c4)

05457

05454

05460

05206

05101

05289

044

7005277

04996

05105

05084

04818

(s0c5)

05410

05407

05412

05071

04946

05170

04303

05138

04803

04947

04924

04594

(s1c0)

056

49056

53056

5605778

05751

05785

05190

058

61058

2405782

05759

05788

(s1c1)

05594

05597

05600

05619

05571

05648

04991

05700

05597

05595

05574

05521

(s1c2)

05539

05539

05544

05458

05389

05508

04788

05534

05364

05406

05383

05249

(s1c3)

05487

05486

05491

05305

05215

05375

04597

05375

05141

05223

05200

04988

(s1c4)

05438

05436

05441

05163

05052

05249

044

1805231

04938

05054

05034

04750

(s1c5)

05394

05390

05396

05032

04902

05132

04255

05097

04751

04900

04880

04532

(s2c0)

05628

05631

05635

05729

056

9705741

05134

058

1105758

05726

05704

05713

(s2c1)

05573

05574

05578

05568

05515

05602

04931

05647

05527

05535

05515

05442

(s2c2)

05518

05518

05523

05408

05336

05463

04729

05482

05297

05349

05326

05172

(s2c3)

05469

05467

05472

05260

05164

05334

04543

05330

05082

05171

05150

04918

(s2c4)

05421

05417

05423

05120

05004

05209

04368

05187

04881

05004

04986

046

85(s2c5)

05377

05373

05379

04993

04858

05096

04209

05055

04699

04855

04835

044

73(s3c0)

05606

05609

05612

05678

05640

05694

05074

05759

05690

05668

05646

05635

(s3c1)

05552

05553

05558

05518

05460

05556

04872

05595

05460

05478

05459

05365

(s3c2)

05499

05498

05503

05362

05284

05422

046

7505434

05233

05295

05273

05099

(s3c3)

05450

05448

05453

05216

05114

05292

04491

05284

05020

05120

05098

04849

(s3c4)

05405

05401

05407

05080

04960

05172

04321

05146

04827

04959

04940

04622

(s3c5)

05362

05357

05363

04955

04816

05063

04166

05017

04651

04815

04793

044

17(s4c0)

05587

05589

05593

05630

05588

05652

05019

05710

05627

05613

05593

05562

(s4c1)

05533

05533

05537

05470

05407

05513

04815

05544

05395

05424

05404

05290

(s4c2)

05480

05479

05484

05316

05232

05380

04620

05386

05171

05242

05220

05026

(s4c3)

05432

05429

05435

05172

05067

05253

044

4005241

04964

05070

05051

04782

(s4c4)

05388

05384

05391

05041

04917

05137

04274

05106

04775

04914

04897

04564

(s4c5)

05347

05341

05347

04918

04774

05029

04123

04979

046

0204773

04752

04361

20 Mathematical Problems in Engineering

Table25Th

eARR

ofSP

ICSford

ailytradingwith

different

transactioncost

Ther

esultthatthere

isno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

03332

03296

03325

02943

02920

02934

03317

02975

03133

02942

03067

03041

(s0c1)

03128

030

8703118

02439

02327

02521

02266

02496

02384

02336

02400

02137

(s0c2)

02924

02879

02912

01936

01735

02108

01216

02017

01636

01731

01734

01234

(s0c3)

02721

02672

02706

01433

0114

301697

00168

01539

00889

01126

01070

00333

(s0c4)

02519

02464

02500

00931

00553

01285

-00878

01062

00143

00522

004

06-00567

(s0c5)

02316

02257

02294

00430

-00037

00875

-019

2400586

-00602

-0008

-00257

-014

66(s1c0)

03249

03212

03242

027

7802729

02794

029

53028

18028

9802747

028

5502762

(s1c1)

03046

03004

03035

02274

02136

02381

01902

02339

02149

02141

02188

01859

(s1c2)

02842

02796

02829

01771

01544

01969

00853

01861

01401

01536

01523

00957

(s1c3)

02639

02588

02623

01269

00953

01557

-00195

01383

00654

00931

00858

000

56(s1c4)

02437

02381

02417

00767

00363

0114

6-012

41009

06-00091

00328

00195

-00844

(s1c5)

02234

02174

02211

00266

-00226

00735

-02285

00430

-00836

-00275

-0046

8-01742

(s2c0)

03167

03129

03159

026

1302538

026

54025

89026

61026

6302551

026

43024

84(s2c1)

02964

02921

02952

02110

01946

02241

01539

02182

01914

01946

01977

01581

(s2c2)

0276

02713

02746

01607

01354

01829

00490

01704

0116

701341

01312

006

79(s2c3)

02557

02505

02540

0110

400763

01418

-00557

01227

004

2000737

006

47-00221

(s2c4)

02355

02298

02334

006

0300173

01007

-016

0300750

-00325

00134

-00016

-01120

(s2c5)

02153

02091

02129

00102

-00416

00597

-0264

700274

-010

69-00469

-00678

-02018

(s3c0)

030

85030

46030

7602448

02348

02514

02225

02504

02428

02356

02431

02206

(s3c1)

02881

02838

02869

01945

01756

02102

0117

502026

01680

01751

01765

01304

(s3c2)

02678

02630

02663

01442

01164

01690

00127

01548

00933

0114

601100

004

02(s3c3)

02476

02422

02457

00940

00574

01279

-00919

01071

00187

00543

00436

-00498

(s3c4)

02273

02215

02252

00439

-00016

00868

-019

6400595

-00558

-0006

-00227

-013

97(s3c5)

02071

02008

02047

-00062

-0060

5004

58-0300

800119

-013

02-00662

-00889

-02294

(s4c0)

03003

02962

02993

02284

02157

02374

01862

02348

02193

02161

02219

01929

(s4c1)

02799

02754

02786

01781

01565

01962

00813

01870

01445

01556

01554

01026

(s4c2)

02597

02547

02580

01278

00974

01551

-00235

01392

00699

00952

00889

00125

(s4c3)

02394

02339

02375

00776

00384

0114

0-012

8100915

-0004

700349

00226

-00774

(s4c4)

02192

02132

02169

00275

-00205

00729

-02326

00439

-00792

-00254

-00437

-016

73(s4c5)

01989

01926

01964

-00225

-00794

00319

-033

69-00037

-015

35-00856

-010

99-02570

Mathematical Problems in Engineering 21

the transaction cost structures (s0 c1) (s0 c2) (s0 c3) (s0c4) (s0 c5) if we do not consider transparent transactioncost ie c=0 the average ARR of RNN is 02531 under thetransaction cost structure (s1 c0) (s2 c0) (s3 c0) (s4c0) so transparent transaction cost has greater impact thanslippage Through multiple comparative analysis the ARRunder the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s0 c1) are not significantly different from the ARRwithout transaction cost for MLP DBN and SAE the ARRunder all other transaction cost structures are significantlysmaller than theARRwithout transaction cost For all tradingalgorithms except for MLP DBN and SAE the ARR underthe transaction cost structures (s1 c0) (s2 c0) are notsignificantly different from the ARR without transactioncost the ARR under all other transaction cost structures aresignificantly smaller than the ARR without transaction cost

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 26 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theASR of each algorithm is the lowest Compared with settingwithout transaction cost the ASR of MLP DBN and SAEreduce by 3997 4123 and 4066 respectively while theASR of other trading algorithms reduce by more than 90compared with the case of no transaction cost Thereforeexcessive transaction cost will significantly reduce ASR Fora general setting of s and c ie (s c) = (002 0003) theASR of MLP DBN and SAE decrease by 2262 2336and 2302 respectively while the ASR of other algorithmsdecrease by more than 50 the ASR of CART and XGBdecrease by more than 100Therefore MLP DBN and SAEare more tolerant to transaction cost From single tradingalgorithm such as NB if we do not consider slippage ies=0 the average ASR of NB is 08052 under the transactioncost structure (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5)if we do not consider transparent transaction cost ie c=0the average ASR of NB is 14182 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has greater impact than slippage Throughmultiple comparative analysis the ASR under the transactioncost structures (s1 c0) (s2 c0) (s3 c0) (s0 c1) are notsignificantly different from the ASR without transaction costfor MLP DBN and SAE the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the ASR under the transaction cost structures(s1 c0) (s2 c0) are not significantly different from the ASRwithout transaction cost the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 27 MDD increases with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the settings without transaction cost theMDD of MLP DBN and SAE increase by 932 1108 and

1032 respectively The MDD of other trading algorithmsincrease by more than 80 compared with those withoutconsidering transaction costTherefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 483 580 and 533respectively while the MDD of other algorithms increase bymore than 35 and theMDDofCART RF andXGB increasebymore than 100Therefore MLP DBN and SAE are moretolerant to transaction cost As awhole theDNNmodels havestronger capacity to accommodate transaction cost than thetraditional ML models From single trading algorithm suchas GRU if we do not consider slippage ie s=0 the averageMDD of GRU is 04459 under the transaction cost structures(s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do notconsider transparent transaction cost ie c=0 the averageMDD of GRU is 03559 under the transaction cost structures(s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparent transactioncost has greater impact than slippage Through multiplecomparative analysis the MDD under any the transactioncost structure is not significantly different from the MDDwithout transaction cost for MLP DBN and SAE For alltrading algorithms except for MLP DBN and SAE such asLR the MDD under the transaction cost structures (s0 c1)(s1 c0) (s2 c0) (s3 c0) are not significantly different fromthe MDD without transaction cost the MDD under all othertransaction cost structures are significantly greater than theMDD without transaction cost

Through the analysis of the Table 27 performance eval-uation indicators we find that trading performance afterconsidering transaction cost will be worse than that withoutconsidering transaction cost as is in actual trading situationIt is noteworthy that the performance changes of DNNalgorithms especially MLP DBN and SAE are very smallafter considering transaction cost This shows that the threealgorithms have good tolerance to changes of transactioncost Especially for the MDD of the three algorithms thereis no significant difference with that with no transactioncost So we can consider applying them in actual tradingMeanwhile we conclude that the transparent transactioncost has greater impact on the trading performances thanthe slippage for SPICS This is because the prices of SPICSare too high when the transparent transaction cost is setto a certain percentage of turnover In actual transactionsspecial attention needs to be paid to the fact that the trans-action performance under most transaction cost structuresis significantly lower than the trading performance withoutconsidering transaction cost It is worth noting that theperformance of traditional ML algorithm is not worse thanthat ofDNNalgorithmswithout considering transaction costwhile the performance of DNN algorithms is better than thatof traditional ML algorithms after considering transactioncost

63 Analysis of Impact of Transaction Cost on the TradingPerformance of CSICS Similar to Section 62 we will discussthe impact of transaction cost on trading performance ofCSICS in the followings In the Chinese A-share marketthe transparent transaction cost is usually set to a certain

22 Mathematical Problems in Engineering

Table26Th

eASR

ofSP

ICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

1546

815

412

15502

15764

15571

15828

13927

16237

16763

15818

16018

16298

(s0c1)

1456

214

478

14577

1300

012

317

13565

09346

13554

12650

12472

12456

11294

(s0c2)

13639

13527

13635

10191

09015

11262

04657

10822

08482

09074

08846

06236

(s0c3)

12702

12561

12679

07355

05690

08929

-00085

08061

04298

05652

05216

0118

2(s0c4)

11751

11581

11709

04511

02366

06580

-04823

05291

00139

02234

01596

-03812

(s0c5)

1079

10591

10728

01678

-00931

04227

-09500

02534

-039

59-01152

-019

87-08696

(s1c0)

15121

1505

715

149

1492

714

606

15119

1244

915

424

1558

214

825

14974

1488

6(s1c1)

14208

14116

14217

12146

11334

12841

07823

12722

1144

711459

11394

09859

(s1c2)

13279

13159

13270

09325

08020

10526

03105

09977

07267

08048

07772

04792

(s1c3)

12337

12188

12308

064

8204690

08185

-016

4607209

03082

04622

04139

-00257

(s1c4)

11382

11204

11333

03637

01368

05831

-06374

04438

-010

6801208

00524

-052

31(s1c5)

10417

10210

10348

00807

-019

2003478

-110

2501686

-05146

-02169

-0304

7-10083

(s2c0)

1477

1469

914

792

1408

113

632

1440

310

946

1460

114

390

1382

213

922

1346

2(s2c1)

13851

13752

13854

11285

10343

12111

06283

11883

10237

10439

10325

08416

(s2c2)

12916

12789

12901

08454

07021

09785

01547

09128

060

4907019

06696

03346

(s2c3)

11969

11812

11934

05607

03688

07437

-032

0506355

01868

03591

03063

-016

90(s2c4)

11010

10825

10955

02763

00372

05081

-07916

03586

-02268

00183

-00545

-06639

(s2c5)

1004

109827

09967

-0006

-02905

02729

-12533

00841

-06323

-031

79-04101

-114

54(s3c0)

14415

14337

14432

13227

12650

13679

09425

13770

13189

12810

12862

12030

(s3c1)

13490

13384

13488

10419

09348

11375

04733

11039

09023

09413

09252

06971

(s3c2)

12551

12416

12529

07580

060

19090

40-00013

08275

04832

05988

05618

01904

(s3c3)

11599

11435

11558

04731

02688

066

88-04757

05500

00658

02562

01988

-031

16(s3c4)

10636

10443

10575

01891

-00620

04331

-0944

202735

-0346

0-00836

-016

08-08034

(s3c5)

09664

09443

09584

-00924

-03883

01982

-14018

000

00-074

89-04183

-05146

-12808

(s4c0)

14058

13972

1406

812

368

11662

12950

07892

12933

11983

11793

11796

10591

(s4c1)

13127

13013

13119

09549

08350

10634

03180

10190

07807

08386

08177

05527

(s4c2)

12183

1204

12155

06705

05018

08293

-015

6807421

03617

04958

04542

004

68(s4c3)

11226

11055

11179

03857

01691

05938

-06295

046

47-00545

01537

00918

-04529

(s4c4)

1026

1006

10193

01021

-016

0703582

-10948

01888

-0464

2-018

49-02665

-09413

(s4c5)

09286

09057

09199

-017

83-04853

01238

-15478

-00836

-0864

2-05177

-06182

-14142

Mathematical Problems in Engineering 23

Table 27 The MDD of SPICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 03583 03584 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338(s0 c1) 03629 03638 03594 03779 03986 03636 04072 03712 03843 03963 03972 04203(s0 c2) 03677 03695 03647 04302 04707 03968 05168 04127 04842 04729 04787 05735(s0 c3) 03727 03756 03703 04990 05639 04376 06564 04709 06172 05682 05844 07335(s0 c4) 03781 03821 03764 05767 06612 04873 07804 05424 07377 06653 06913 08447(s0 c5) 03839 03890 03828 06529 0746 05444 08730 06162 08272 07501 07808 09118(s1 c0) 03596 03600 03560 03500 036130 03446 03574 03502 03414 03585 03569 03540(s1 c1) 03642 03655 03609 03907 04156 03717 04320 03814 04067 04154 04170 04541(s1 c2) 03691 03712 03662 04466 04936 04066 05534 04270 05172 04971 05049 06168(s1 c3) 03742 03774 03720 05183 05895 04495 06928 04885 06499 05937 06129 07662(s1 c4) 03796 03839 03781 05961 06842 05013 08105 05610 07631 06884 07161 08649(s1 c5) 03856 03909 03847 0671 07646 05595 08946 06342 08451 07691 0800 09235(s2 c0) 03609 03615 03573 03607 03756 03517 03770 03586 03586 03739 03727 03787(s2 c1) 03656 03671 03623 04047 04349 03805 04627 03929 04339 04365 04397 04929(s2 c2) 03705 03729 03678 04642 05176 04171 05916 04424 05504 05218 05327 06577(s2 c3) 03756 03792 03736 05377 06143 04624 07277 05067 06805 06183 06402 07939(s2 c4) 03812 03859 03799 06155 07056 05161 08380 05796 07856 07099 07388 08816(s2 c5) 03873 03930 03866 06887 07816 05751 09126 06517 08606 07864 08172 09331(s3 c0) 03622 03631 03588 03729 03912 03594 04004 03685 03795 03909 03909 04081(s3 c1) 03669 03687 03639 04200 04555 03901 04966 04062 04622 04587 04642 05334(s3 c2) 03719 03746 03694 04826 05423 04286 06295 04589 05833 05465 05607 06936(s3 c3) 03772 03811 03754 05572 06377 04762 07609 05248 07081 06420 06657 08175(s3 c4) 03829 03879 03818 06341 07254 05314 08620 05980 08054 07300 07593 08956(s3 c5) 03894 03954 03888 07056 07972 05909 09275 06689 08740 08022 08325 09412(s4 c0) 03635 03647 03602 03861 04082 03678 04274 03798 04015 04096 04114 04396(s4 c1) 03683 03704 03654 04362 04774 04005 05325 04211 04908 04814 04894 05730(s4 c2) 03734 03765 03712 05013 05664 04410 06667 04758 06142 05707 05875 07253(s4 c3) 03790 03833 03775 05765 06600 04905 07906 05429 07330 06644 06894 08375(s4 c4) 03851 03904 03841 06521 07439 05470 08824 06162 08230 07485 07782 09074(s4 c5) 03917 03981 03913 07218 08115 06067 09395 06857 08858 08165 08463 09480

percentage of turnover and it is the same as the assumptionin the experimental settings As in the US stock market thesmallest unit of price change is 001 (one tick) It is reasonableto set slippage to be 001-005 Of course it should be notedthat the prices fluctuation may be more intense when closingthan that in the middle of a trading day

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 28 the WR is decreasing with the increaseof transaction cost for any trading algorithm When thetransaction cost is set to (s c) = (004 0005) the WR of eachalgorithm is the smallest Comparedwith the settings withouttransaction cost the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR SVM and XGB are reduced by671 688 697 2269 1726 1548 2430 14912484 2112 2112 and 2919 respectively For a generalsetting of s and c ie (s c) = (002 0003) the WR ofMLP DBN and SAE decrease by 410 420 and 430respectively while the WR of other algorithms decrease bymore than 9 the WR of CART RF and XGB decrease by

more than 15 Therefore MLP DBN and SAE are moretolerant to transaction cost From single trading algorithmsuch as LSTM if we do not consider slippage ie s=0 theaverage WR of DBN is 05417 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage WR of LSTM is 05304 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the WR under the transactioncost structures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the WR without transaction cost for MLPDBN SAE and NB the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN SAE and NB the WR under the transaction coststructure (s0 c1) is not significantly different from the WRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

24 Mathematical Problems in Engineering

Table 28 The WR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803(s0 c1) 05523 05527 05525 05525 05608 05620 05009 05227 05612 05665 05571 05595(s0 c2) 05488 05492 05489 05389 05512 05535 04879 05149 05460 05542 05445 05411(s0 c3) 05453 05456 05452 05258 05414 05451 04747 05068 05313 05418 05320 05234(s0 c4) 05417 05419 05414 05127 05320 05368 04622 04991 05172 05297 05202 05067(s0 c5) 05383 05383 05379 05004 05230 05286 04504 04917 05036 05180 05088 04905(s1 c0) 05494 05499 05497 05444 05541 05558 04925 05170 05520 05584 05492 05488(s1 c1) 05456 05459 05456 05286 05424 05456 04775 05080 05342 05437 05345 05275(s1 c2) 05421 05423 05420 05161 05335 05377 04654 05007 05207 05320 05231 05110(s1 c3) 05386 05388 05383 05036 05246 05296 04530 04931 05065 05205 05116 04946(s1 c4) 05353 05354 05349 04915 05156 05218 04419 04861 04937 05095 05007 04795(s1 c5) 05323 05323 05317 04808 05076 05148 04315 04796 04817 04995 04905 04652(s2 c0) 05431 05434 05431 05219 05368 05403 04707 05036 05269 05374 05286 05189(s2 c1) 05395 05397 05393 05078 05266 05314 04573 04956 05115 05242 05154 05005(s2 c2) 05360 05361 05357 04960 05181 05237 04458 04886 04985 05134 05046 04853(s2 c3) 05331 05331 05326 04850 05100 05167 04352 04818 04864 05031 04945 04711(s2 c4) 05300 05300 05293 04743 05018 05093 04252 04752 04746 04931 04846 04572(s2 c5) 05273 05271 05266 04648 04946 05029 04159 04692 04639 04838 04755 04445(s3 c0) 05373 05374 05371 05019 05216 05265 04514 04917 05049 05186 05098 04932(s3 c1) 05341 05341 05336 04902 05128 05188 04399 04846 04917 05074 04990 04775(s3 c2) 05312 05312 05306 04798 05052 05122 04303 04782 04804 04977 04896 04644(s3 c3) 05281 05281 05275 04696 04976 05049 04206 04718 04689 04879 04799 04509(s3 c4) 05252 05251 05245 04598 04901 04984 04110 04657 04581 04785 04707 04378(s3 c5) 05226 05223 05218 04510 04833 04924 04023 04602 04481 04701 04621 04264(s4 c0) 05325 05325 05321 04860 05089 05150 04360 04816 04870 05030 04949 04723(s4 c1) 05294 05294 05289 04753 05010 05079 04258 04750 04752 04928 04849 04588(s4 c2) 05266 05265 05259 04653 04937 05013 04164 04690 04642 04838 04761 04458(s4 c3) 05238 05236 05230 04562 04864 04948 04073 04632 04541 04747 04672 04336(s4 c4) 05211 05208 05203 04475 04798 04891 03985 04577 04440 04662 04586 04218(s4 c5) 05186 05182 05176 04392 04733 04832 03901 04524 04348 04582 04509 04109

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 29 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the smallest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 5073 5175 and 5225 respectivelyWhile the ARR of other trading algorithms decrease bymore than 100 compared with those algorithms withouttransaction cost Therefore excessive transaction cost canlead to serious losses in the accounts For a general settingof s and c ie (s c) = (002 0003) ARR of MLP DBNand SAE decrease by 2741 2797 and 2825 respectivelywhile the ARR other algorithms decrease by more than 50and that of CART NB RF and XGB decrease by more than100 Therefore MLP DBN and SAE are more tolerant totransaction cost From single trading algorithm such as SAEif we do not consider slippage ie s=0 the average ARR ofSAE is 05040 under the transaction cost structure (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not consider

transparent transaction cost ie c=0 the averageARRof SAEis 04468 under the transaction cost structures (s1 c0) (s2c0) (s3 c0) (s4 c0) so transparent transaction cost hassmaller impact than slippage Through multiple comparativeanalysis the ARR under the transaction cost structures (s0c1) (s0 c2) (s0 c3) (s0 c1) (s1 c1) are not significantlydifferent from the ARR without transaction cost for MLPDBN and SAE the ARR under all other transaction coststructures are significantly smaller than the ARR withouttransaction cost For RNN LSTM GRU CART RF LR andSVM the ARR under the transaction cost structures (s0c1) (s0 c2) (s1 c0) are not significantly different fromthe ARR without transaction cost the ARR under all othertransaction cost structures are significantly smaller than theARR without transaction cost For NB and XGB the ARRunder the transaction cost structures (s0 c1) (s1 c0) arenot significantly different from the ARR without transactioncost the ARR under all other transaction cost structuresare significantly smaller than the ARR without transactioncost

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 8: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

8 Mathematical Problems in Engineering

Table 5Multiple comparison analysis between theAR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 10000GRU 00000 00000 00000 08273 09811CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00232 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 07649SVM 00000 00000 00000 00000 00000 00000 06057 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00002 02010 00000

Table 6Multiple comparison analysis between the PR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 09999SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00034GRU 00000 00000 00000 00000 01472CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 07869 05786 00000 00000RF 00000 00000 00000 00000 00000 00000 08056 00000LR 00000 00000 00000 00000 00000 00000 09997 00000 02626SVM 00000 00000 00000 00000 00000 00000 00008 00000 03104 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00491 00000 09999

Table 5 The number in the table is a p value of any two algo-rithms of Nemenyi test When p valuelt005 we think thatthe two trading algorithms have a significant differenceotherwise we cannot deny the null assumption that the meanvalues of AR of the two algorithms are equal From Tables 5and 4 we can see that the AR of all DNN models are signif-icantly lower than those of all traditional MLmodelsTheARof MLP DBN and SAE are significantly greater than those ofRNN LSTM and GRU There are no significant differencesamong the AR of MLP DBN and SAE There are no sig-nificant differences among the AR of RNN LSTM and GRU

(2) Through the hypothesis test analysis of H2a and H2bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between the PR of all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 6 The number in the table is a pvalue of any two algorithms of Nemenyi test From Tables 6and 4 we can see that the PR of MLP DBN and SAE aresignificantly greater than that of other trading algorithmsThe PR of LSTM is not significantly different from that ofGRU and NBThe PR of GRU is significantly lower than thatof all traditional ML algorithms The PR of NB is significantlylower than that of other traditional ML algorithms

(3) Through the hypothesis test analysis of H3a and H3bwe can obtain p valuelt22e-16 So there are statistically

significant differences between the RR of all trading algo-rithms Therefore we need to make multiple comparativeanalysis further as shown in Table 7 The number in thetable is a p value of any two algorithms of Nemenyi testFrom Tables 7 and 4 we can see that there is no significantdifference among the RR of all DNN models but the RRof any DNN model is significantly lower than that of alltraditional ML models The RR of NB is significantly lowerthan that of other traditional ML algorithms The RR ofCART is significantly lower than that of other traditional MLalgorithms except for NB

(4) Through the hypothesis test analysis of H4a and H4bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between the F1 of all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 8 The number in the table is a pvalue of any two algorithms of Nemenyi test From Tables8 and 4 we can see that there is no significant differenceamong the F1 of MLP DBN and SAE The F1 of MLP DBNand SAE are significantly greater than that of RNN LSTMGRU andNB but are significantly smaller than that of RF LRSVM and XGBThe F1 of GRU and LSTMhave no significantdifference but they are significantly smaller than that of alltraditional ML algorithms The F1 of XGB is significantlygreater than that of all other trading algorithms

Mathematical Problems in Engineering 9

Table 7Multiple comparison analysis between the RR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 10000 10000 10000LSTM 10000 10000 10000 10000GRU 09999 10000 09999 10000 10000CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00485 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 00555SVM 00000 00000 00000 00000 00000 00000 00197 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00010 09958 00000

Table 8Multiple comparison analysis between the F1 of any two trading algorithms The p value of the two trading strategies with significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 09998SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00810GRU 00000 00000 00000 00000 03489CART 00861 00061 00117 00000 00000 00000NB 00000 00000 00000 04635 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00078 00000LR 00000 00000 00000 00000 00000 00000 00173 00000 10000SVM 00007 00000 00000 00000 00000 00000 09797 00000 03336 04825XGB 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000

Table 9 Multiple comparison analysis between the AUC of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 10000 10000 10000LSTM 10000 10000 10000 09999GRU 10000 10000 10000 10000 09975CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00270 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 05428SVM 00000 00000 00000 00000 00000 00000 03125 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00002 03954 00000

(5) Through the hypothesis test analysis of H5a and H5bwe can obtain p valuelt22e-16 So there are statisticallysignificant differences between the AUC of all trading algo-rithms Therefore we need to make multiple comparativeanalysis further as shown in Table 9 The number in thetable is a p value of any two algorithms of Nemenyi testFrom Tables 9 and 4 we can see that there is no significantdifference among the AUC of all DNN models The AUC of

all DNN models are significantly smaller than that of anytraditional ML model

(6) Through the hypothesis test analysis of H6a and H6bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between theWRof all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 10 The number in the table is pvalue of any two algorithms of Nemenyi test From Tables 4

10 Mathematical Problems in Engineering

Table10M

ultip

lecomparis

onanalysisbetweentheW

Rof

anytwotradingalgorithm

sTh

epvalueo

fthe

twotradingstr

ategiesw

ithsig

nificantd

ifference

isin

boldface

Index

BAH

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

BAH

000

00MLP

000

00000

00DBN

000

00000

0010

000

SAE

000

00000

0010

000

1000

0RN

N000

00000

00000

00000

00000

00LSTM

000

00000

00000

00000

00000

0009974

GRU

000

11000

00000

01000

00000

0010

000

09961

CART

000

0009998

000

00000

00000

00000

00000

00000

00NB

000

00000

00000

00000

00000

00000

31000

00000

38000

00RF

000

00000

00000

00000

00000

0000118

000

0100140

000

0010

000

LR000

00000

00000

00000

00000

0010

000

08508

1000

0000

00004

320117

7SV

M000

00000

00000

00000

00000

0010

000

1000

010

000

000

00000

01000

0609780

XGB

000

00000

00000

00000

00000

0002660

000

8402927

000

0009831

09989

07627

00376

Mathematical Problems in Engineering 11

Table 11Multiple comparison analysis between theARRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00001 00006 00001LSTM 00000 00000 00000 00002 00000 10000GRU 00000 00000 00001 00008 00001 10000 10000CART 00000 00000 10000 10000 10000 00001 00000 00001NB 00000 00000 00021 00094 00022 10000 09998 10000 00018RF 00000 00000 07978 09524 08036 01685 00874 01962 07745 05861LR 00000 00000 00002 00012 00002 10000 10000 10000 00002 10000 02408SVM 00000 00000 02375 04806 02427 07029 05214 07457 02178 09778 09999 08015XGB 00000 00000 00674 01856 00694 09423 08466 09576 00600 09996 09905 09739 10000

Table 12Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 09667MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 08763 07617 08998LSTM 00000 00000 09922 09701 09949 10000GRU 00000 00000 06124 04563 06537 10000 09996CART 00000 00000 00002 00005 00002 00000 00000 00000NB 00000 00000 00467 00233 00557 09529 07037 09971 00000RF 00000 00000 00000 00000 00000 00291 00042 01062 00000 08010LR 00000 00000 07506 06025 07859 10000 10000 10000 00000 09872 00602SVM 00000 00000 01759 01020 02010 09982 09399 10000 00000 10000 04671 09998XGB 00000 00000 00099 00044 00122 07548 03776 09470 00000 10000 09681 08791 09997

and 10 we can see that the WR of MLP DBN and SAE haveno significant difference but they are significantly higherthan that of BAH and benchmark index and significantlylower than that of other trading algorithms TheWR of RNNLSTM and GRU have no significant difference but they aresignificantly higher than that of CART and significantly lowerthan that of NB and RF The WR of LR is not significantlydifferent from that of RF SVM and XGB

(7) Through the analysis of the hypothesis test of H7aand H7b we obtain p valuelt22e-16 Therefore there aresignificant differences between the ARR of all trading strate-gies including the benchmark index and BAH We needto do further multiple comparative analysis as shown inTable 11 From Tables 4 and 11 we can see that the ARR ofthe benchmark index and BAH are significantly lower thanthat of all ML algorithms The ARR of MLP DBN and SAEare significantly greater than that of RNN LSTM GRU NBand LR but not significantly different from that of CARTRF SVM and XGB there is no significant difference betweenthe ARR of MLP DBN and SAE The ARR of RNN LSTM

and GRU are significantly less than that of CART but theyare not significantly different from that of other traditionalML algorithms In all traditional ML algorithms the ARR ofCART is significantly greater than that of NB and LR butotherwise there is no significant difference between ARR ofany other two algorithms

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore there are significantdifferences between ASR of all trading strategies includingthe benchmark index and BAH The results of our multiplecomparative analysis are shown in Table 12 From Tables 4and 12 we can see that the ASR of the benchmark index andBAH are significantly smaller than that of all ML algorithmsThe ASR of MLP and DBN are significantly greater than thatof CART and are significantly smaller than that of NB RFand XGB but there is no significant difference between MLPDBN and other algorithms The ASR of SAE is significantlygreater than that of CART and significantly less than that ofRF and XGB but there is no significant difference betweenSAE and other algorithms The ASR of RNN and LSTM

12 Mathematical Problems in Engineering

Table 13 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00052DBN 00000 00031 10000SAE 00000 00012 10000 10000RNN 00000 00000 01645 02243 03556LSTM 00000 00000 06236 07173 08511 10000GRU 00000 00000 00245 00381 00760 10000 09860CART 00000 00000 01496 02057 03309 10000 10000 10000NB 00000 00000 00786 01136 01999 10000 09994 10000 10000RF 00000 00000 00002 00004 00012 08964 04248 09980 09109 09713LR 00000 00000 05451 06428 07935 10000 10000 09933 10000 09998 05015SVM 00000 00000 02433 03194 04734 10000 10000 09999 10000 10000 08155 10000XGB 00000 00000 00103 00167 00360 09998 09462 10000 09999 10000 09998 09685 09989

Table 14 Trading performance of different trading strategies in CSICS Best performance of all trading strategies is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGBAR mdash mdash 05175 05167 05163 05030 04993 04993 05052 05084 05090 05084 05112 05087PR mdash mdash 07548 07436 07439 05414 04964 04956 05022 05109 05128 04967 05695 05026RR mdash mdash 05252 05250 05248 05234 05224 05223 05279 05307 05311 05318 05295 05315F1 mdash mdash 06150 06108 06108 05320 05086 05082 05143 05192 05214 05132 05483 05164AUC mdash mdash 05027 05024 05020 05006 04995 04996 05049 05078 05082 05086 05074 05085WR 05222 05090 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803ARR 00633 02224 05731 05704 05678 05248 05165 05113 05534 06125 04842 05095 05004 04938ASR 02625 04612 14031 14006 13935 14880 15422 15505 12232 11122 14379 15582 14231 14698MDD 04808 06697 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632

are significantly greater than that of CART and significantlyless than that of RF but there is no significant differencebetweenRNN LSTM and other algorithmsTheASRofGRUis significantly greater than that of CART but there is nosignificant difference between GRU and other traditional MLalgorithms In all traditional ML algorithms the ASR of allalgorithms are significantly greater than that of CART butotherwise there is no significant difference between ASR ofany other two algorithms

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between MDD of trading strategies includingthe benchmark index and the BAH The results of multiplecomparative analysis are shown in Table 13 From Tables4 and 13 we can see that MDD of any ML algorithm issignificantly greater than that of the benchmark index butsignificantly smaller than that of BAH strategy The MDDof MLP and DBN are significantly smaller than those ofGRU RF and XGB but there is no significant differencebetween MLP DBN and other algorithms The MDD ofSAE is significantly smaller than that of XGB but there isno significant difference between SAE and other algorithmsOtherwise there is no significant difference betweenMDDofany other two algorithms

In a word the traditional ML algorithms such as NBRF and XGB have good performance in most directional

evaluation indicators such as AR PR and F1 The DNNalgorithms such as MLP have good performance in PR andARR In traditional ML algorithms the ARR of CART RFSVM and XGB are not significantly different from that ofMLP DBN and SAE the ARR of CART is significantlygreater than that of LSTM GRU and RNN but otherwisethe ARR of all traditional ML algorithms are not significantlyworse than that of LSTM GRU and RNN The ASR of alltraditional ML algorithms except CART are not significantlyworse than that of the six DNNmodels even the ASR of NBRF and XGB are significantly greater than that of some DNNalgorithms The MDD of RF and XGB are significantly lessthat of MLP DBN and SAE the MDD of all traditional MLalgorithms are not significantly different from that of LSTMGRU and RNNThe ARR and ASR of all ML algorithms aresignificantly greater than that of BAH and the benchmarkindex the MDD of any ML algorithm is significantly greaterthan that of the benchmark index but significantly less thanthat of BAH strategy

53 Comparative Analysis of Performance of Different TradingStrategies in CSICS The analysis methods of this part aresimilar to Section 52 From Table 14 we can see that the ARPR and F1 of MLP are the greatest in all trading algorithmsThe RR AUC WR and ASR of LR are the greatest inall trading algorithms respectively The ARR of NB is the

Mathematical Problems in Engineering 13

Table 15Multiple comparison analysis between theARof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 01857GRU 00000 00000 00000 04439 10000CART 00000 00000 00000 09765 00024 00131NB 00000 00001 00002 00022 00000 00000 01810RF 00000 00002 00005 00007 00000 00000 00941 10000LR 00000 00000 00000 00076 00000 00000 03454 10000 10000SVM 00217 00766 01309 00000 00000 00000 00003 08314 09352 06360XGB 00000 00001 00001 00025 00000 00000 01930 10000 10000 10000 08168

Table 16Multiple comparison analysis between the PRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 09906 09781NB 00000 00000 00000 00000 01716 01234 08940RF 00000 00000 00000 00000 00319 00205 05271 10000LR 00000 00000 00000 00000 10000 10000 09951 02099 00422SVM 00000 00000 00000 01157 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00000 09922 09811 10000 08836 05086 09960 00000

highest in all trading strategies The MDD of CSI 300 index(benchmark index) is the smallest in all trading strategiesTheWRARR and ASR of all ML algorithms are greater thanthose of the benchmark index and BAH strategy

(1) Through the hypothesis test analysis of H1a and H1bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the AR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 15The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 15 we can see that the AR ofMLPDBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms except for SVM The ARof GRU is significantly smaller than that of all traditional MLalgorithms There is no significant difference between the ARof any two traditional ML algorithms except for CART andSVM

(2) Through the hypothesis test analysis of H2a and H2bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the PR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 16 The number in the tableis a p value of any two algorithms of Nemenyi test FromTables 14 and 16 we can see that the PR of MLP DBN and

SAE are significantly greater than that of all other tradingalgorithms and the PR of MLP DBN and SAE have nosignificant difference The PR of SVM is significantly greaterthan that of all other traditional ML algorithms which haveno significant difference between any two algorithms exceptfor SVM The PR of RNN is significantly greater than thatof all traditional ML algorithms except for SVM The PR ofGRU and LSTM are not significantly different from that of alltraditional ML algorithms except for SVM and LR

(3) Through the hypothesis test analysis of H3a and H3bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the RR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 17 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 17 we can see that the RR of all DNN models arenot significantly different There is no significant differenceamong the RR of all traditional ML algorithms The RR ofRNN GRU and LSTM are significantly smaller than that ofany traditional ML algorithm except for CART

(4) Through the hypothesis test analysis of H4a and H4bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the F1 of all trading algorithms There-fore we need to do further multiple comparative analysis and

14 Mathematical Problems in Engineering

Table 17Multiple comparison analysis between the RRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 09996 09996 10000LSTM 09309 09314 09781 09999GRU 09660 09663 09916 10000 10000CART 09744 09742 09225 05809 01509 02138NB 01093 01088 00574 00075 00004 00007 08861RF 00537 00534 00260 00028 00001 00002 07544 10000LR 00330 00328 00152 00015 00001 00001 06498 10000 10000SVM 03444 03434 02170 00434 00033 00059 09920 10000 09998 09991XGB 00193 00192 00085 00007 00000 00000 05344 10000 10000 10000 09960

Table 18 Multiple comparison analysis between the F1 of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 07211 06670NB 00000 00000 00000 00136 00132 00099 08664RF 00000 00000 00000 00786 00016 00011 05162 10000LR 00000 00000 00000 00000 09440 09208 10000 05675 02181SVM 00000 00000 00000 00178 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00001 03138 02679 10000 09937 08849 09964 00000

Table 19 Multiple comparison analysis between the AUC of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 09999 10000RNN 09945 09985 10000LSTM 05273 06382 09259 09937GRU 08448 09102 09958 10000 10000CART 06921 05835 02356 00801 00014 00096NB 00002 00001 00000 00000 00000 00000 02616RF 00001 00001 00000 00000 00000 00000 02002 10000LR 00000 00000 00000 00000 00000 00000 00930 10000 10000SVM 00027 00014 00001 00000 00000 00000 06454 10000 09999 09980XGB 00000 00000 00000 00000 00000 00000 01257 10000 10000 10000 09993

the results are shown in Table 18The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 18 we can see that the F1 of MLP DBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms There is no significantdifference among traditionalML algorithms except SVM andthe F1 of SVM is significantly greater than that of all othertraditional ML algorithms

(5) Through the hypothesis test analysis of H5a and H5bwe can obtain p valuelt22e-16Therefore there are significantdifferences between theAUCof all trading algorithmsThere-fore we need to do further multiple comparative analysis andthe results are shown in Table 19 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 19 we can see that the AUC of all DNN models haveno significant difference There is no significant difference

Mathematical Problems in Engineering 15

Table 20 Multiple comparison analysis between the WR of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 04117MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00002 00006 00000LSTM 00000 00000 00000 00000 00000 09772GRU 00000 00000 00000 00000 00000 09911 10000CART 09931 00000 00000 00000 00000 00000 00000 00000NB 00031 00000 00001 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00205 06437 05358 00000 00000LR 00000 00000 00000 00000 00000 00010 01611 01105 00000 00000 10000SVM 00000 00000 00000 00000 00000 09914 10000 10000 00000 00000 05322 01090XGB 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000

Table 21Multiple comparison analysis between theARRof any two trading strategiesThepvalue of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00007MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 04790 06355 07182LSTM 00000 00000 02512 03806 04630 10000GRU 00000 00000 02235 03454 04249 10000 10000CART 00000 00000 08301 09217 09542 10000 09999 09998NB 00000 00000 10000 10000 10000 02920 01295 01125 06517RF 00000 00000 00020 00048 00076 08705 09735 09806 05393 00006LR 00000 00000 02058 03222 03995 10000 10000 10000 09996 01019 09845SVM 00000 00000 10000 00803 01114 09993 10000 10000 09659 00165 09999 10000XGB 00000 00000 10000 00333 00484 09916 09997 09998 08789 00057 10000 09999 10000

between the AUC of all traditional ML algorithms TheAUC of all traditional ML algorithms except for CART aresignificantly greater than that of any DNN model There isno significant difference among the AUC ofMLP SAE DBNRNN and CART

(6)Through the hypothesis test analysis of H6a and H6bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the WR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 20 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 20 we can see that the WR of BAH and benchmarkindex have no significant difference but they are significantlysmaller than that of anyML algorithmTheWRofMLPDBNand SAE are significantly smaller than that of the other trad-ing algorithms but there is no significant difference betweenthe WR of MLP DBN and SAE The WR of LSTM andGRU have no significant difference but they are significantlysmaller than that of XGB and significantly greater than that of

CART and NB In traditional MLmodels the WR of NB andCART are significantly smaller than that of other algorithmsThe WR of XGB is significantly greater than that of all otherML algorithms

(7)Through the analysis of the hypothesis test of H7a andH7b we obtain p valuelt22e-16

Therefore there are significant differences between theARR of all trading strategies including the benchmark indexand BAH strategy Therefore we need to do further multiplecomparative analysis and the results are shown in Table 21FromTables 14 and 21 we can see that ARR of the benchmarkindex and BAH are significantly smaller than that of alltrading algorithms The ARR of MLP is significantly higherthan that of RF but there is no significant difference betweenMLP and other algorithms The ARR of SAE and DBN aresignificantly higher than that of RF and XGB but they arenot significantly different fromARR of other algorithms TheARR of NB is significantly higher than that of RF SVMand XGB But otherwise there is no significant difference

16 Mathematical Problems in Engineering

Table 22Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 08877MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 09099 08862 08114LSTM 00000 00000 03460 03080 02239 09999GRU 00000 00000 02132 01853 01270 09981 10000CART 00000 00000 00158 00195 00327 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000 00000 07298RF 00000 00000 10000 10000 10000 09968 07444 05789 00018 00000LR 00000 00000 01181 01003 00650 09879 10000 10000 00000 00000 04044SVM 00000 00000 10000 10000 10000 09849 05952 04238 00042 00000 10000 02704XGB 00000 00000 09937 09902 09746 10000 09878 09532 00001 00000 10000 08723 09998

Table 23 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00006DBN 00000 00004 10000SAE 00000 00023 10000 10000RNN 00000 00000 00320 00421 00111LSTM 00000 00000 00002 00003 00000 09947GRU 00000 00000 00001 00001 00000 09767 10000CART 00000 00000 01238 01538 00521 10000 09241 08305NB 00000 01875 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 01180 01469 00493 10000 09298 08401 10000 00000LR 00000 00000 00001 00002 00000 09881 10000 10000 08821 00000 08898SVM 00000 00000 03285 03839 01701 09999 07011 05424 10000 00000 10000 06216XGB 00000 00000 00308 00405 00106 10000 09951 09783 10000 00000 10000 09890 09998

between any other two algorithms Therefore the ARR ofmost traditional ML models are not significantly worse thanthat of the best DNNmodel

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore There are significantdifferences betweenASRof all trading strategies including thebenchmark index and BAH strategy The results of multiplecomparative analysis are shown in Table 22 From Tables 14and 22 we can see that the ASR of the benchmark indexand BAH are significantly smaller than that of all tradingalgorithms The ASR of all ML algorithms are significantlyhigher than that of CART and NB but there is no significantdifference between the ASR of CART and NB Beyond thatthere is no significant difference between any other twoalgorithms Therefore the ASR of all traditional ML modelsexcept NB and CART are not significantly worse than that ofany DNNmodel

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between the MDD of these trading strategies

including the benchmark index and the BAH strategyThe results of multiple comparative analysis are shown inTable 23 From Tables 14 and 23 we can see that the MDDof the benchmark index is significantly smaller than that ofother trading strategies including BAH strategy TheMDD ofBAH is significantly greater than that of all trading algorithmsexcept NBTheMDDofMLPDBN and SAE are significantlylower than that of NB but significantly higher than thatof RNN LSTM GRU LR and XGB The MDD of NB issignificantly greater than that of all other trading algorithmsBeyond that there is no significant difference between anyother two algorithms Therefore all ML algorithms expectNB especially LSTM RNN GRU LR and XGB can play arole in controlling trading risk

In a word some DNN models such as MLP DBN andSAE have good performance in AR PR and F1 traditionalML algorithms such as LR and XGB have good performanceinAUCandWRTheARRof some traditionalML algorithmssuch as CART NB LR and SVM are not significantlydifferent from that of the six DNN models The ASR of the

Mathematical Problems in Engineering 17

six DNN algorithms are not significantly different from alltraditional ML models except NB and CART The MDD ofLR and XGB are significantly smaller than those of MLPDBN and SAE and are not significantly different fromthat of LSTM GRU and RNN The ARR and ASR of allML algorithms are significantly greater than those of BAHand benchmark index the MDD of all ML algorithms aresignificantly smaller than that of the benchmark index butsignificantly greater than that of BAH strategy

From the above analysis and evaluation we can see thatthe directional evaluation indicators of some DNN modelsare very competitive in CSICS while the indicators of sometraditional ML algorithms have excellent performance inSPICS Whether in SPICS or CSICS the ARR and ASR ofall ML algorithms are significantly greater than that of thebenchmark index and BAH strategy respectively In all MLalgorithms there are always some traditional ML algorithmswhich are not significantly worse than the best DNN modelfor any performance evaluation indicator (ARR ASR andMDD)Therefore if we do not consider transaction cost andother factors affecting trading performance of DNN modelsare alternative but not the best choice when they are appliedto stock trading

In the same period the ARR of any ML algorithm inCSICS is significantly greater than that of the same algorithmin SPICS (p valuelt0001 in theNemenyi test)Meanwhile theMDD of any ML algorithm in CSICS is significantly greaterthan that of the same algorithm in SPICS (p value lt0001in the Nemenyi test) The results show that the quantitativetrading algorithms can more easily obtain excess returns inthe Chinese A-share market but the volatility risk of tradingin Chinese A-share market is significantly higher than that ofthe US stock market in the past 8 years

6 The Impact of Transaction Cost onPerformance of ML Algorithms

Trading cost can affect the profitability of a stock tradingstrategy Transaction cost that can be ignored in long-termstrategies is significantly magnified in daily trading Howevermany algorithmic trading studies assume that transactioncost does not exist ([10 17] etc) In practice frictions suchas transaction cost can distort the market from the perfectmodel in textbooks The cost known prior to trading activityis referred to as transparent such as commissions exchangefees and taxes The costs that has to be estimated are knownas implicit including comprise bid-ask spread latency orslippage and related market impact This section focuses onthe transparent and implicit cost and how do they affecttrading performance in daily trading

61 Experimental Settings and Backtesting Algorithm In thispart the transparent transaction cost is calculated by a certainpercentage of transaction turnover for convenience theimplicit transaction cost is very complicated in calculationand it is necessary to make a reasonable estimate for therandom changes of market environment and stock pricesTherefore we only discuss the impact of slippage on tradingperformance

The transaction cost structures of American stocks aresimilar to that of Chinese A-shares We assume that transpar-ent transaction cost is calculated by a percentage of turnoversuch as less than 05 [40 41] and 02 and 05 in theliterature [42] It is different for the estimation of slippage

In some quantitative trading simulation software such asJoinQuant [43] and Abuquant [44] the slippage is set to 002The transparent transaction cost and implicit transaction costare charged in both directions when buying and selling Itis worth noting that the transparent transaction cost varieswith the different brokers while the implicit transaction costis related to market liquidity market information networkstatus trading software etc

We set slippages s = s0=0 s1=001 s2=002 s3=003s4=004 the transparent transaction cost c = c0=0 c1=0001c2=0002 c3=0003 c4=0004 c5=0005 For different s ccombinations we study the impact of different transactioncost structures on trading performance We assume thatbuying and selling positions are one unit so the turnover isthe corresponding stock price When buying stocks we notonly need to pay a certain percentage cost of the purchaseprice but also need to pay an uncertain slippage cost Thatis we need to pay a higher price than the real-time price119875119905minus1

when we are buying But when selling stocks we notonly need to pay a certain percentage cost of the sellingprice but also to pay an uncertain slippage cost Generallyspeaking we need to sell at a price lower than the real-timeprice 119875

119905 It is worth noting that our trading strategy is self-

financing If ML algorithms predict the continuous occur-rence of buying signals or selling signals ie |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 0 we will continue to hold or do nothingso the transaction cost at this time is 0 when |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 1 it is indicated that the position maybe changed from holding to selling or from empty positionto buying At this time we would pay transaction costdue to the trading operation Finally we get a real yieldis

119877119890119905119905le119862119897119900119904119890119875119903119894119888119890

119905minus 119862119897119900119904119890119875119903119894119888119890

119905minus1

119862119897119900119904119890119875119903119894119888119890119905minus1

119875119905= 119862119897119900119904119890119875119903119894119888119890

119905

lowast (1 minus 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816)

minus 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816

119875119905minus1

= 119862119897119900119904119890119875119903119894119888119890119905minus1

lowast (1 + 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816)

+ 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816

119877119890119905119905=119875119905minus 119875119905minus1

119875119905minus1

(5)

where 119862119897119900119904119890119875119903119894119888119890119905

denotes the 119905-th closing price119879119903119886119889119890119878119894119892119899119886119897

119905denotes the 119905-th trading signal 119875

119905denotes

the 119905-th executing price and 119877119890119905119905denotes the 119905-th return rate

We propose a backtesting algorithm with transaction costbased on the above analysis as is shown in Algorithm 3

18 Mathematical Problems in Engineering

Input TS TS is trading signals of a stocks s is slippagec c is transparent transaction cost

Output WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) WR=NULL ARR=NULL ASR=NULL MDD=NULL(3) for (i in 1 N) (4) Stock Data=Stock Code List[i](5) ClosePricet=Stock Data [ldquoClosing Pricerdquo](6) Pt =ClosePricet lowast(1-clowastabs(TSt-TSt-1)) - slowastabs(TSt-TSt-1)(7) Pt-1 =ClosePricetlowast(1+clowastabs(TSt-TSt-1)) + slowastabs(TSt-TSt-1)(8) Rett= (Pt- Pt-1) Pt Ret is the return rate series(9) TDRR=lag (TS)lowastRet TDRR is the daily return through trading(10) WR[i]=sum (TDRRgt0)sum(TDRR =0)(11) ARR[i]=Returnannualized (TDRR)(12) ASR[i]=SharpeRatioannualized (TDRR)(13) MDD[i]=maxDrawDown (TDRR)(14) WR=c (WR WR[i])(15) ARR=c (ARR ARR[i])(16) ASR=c (ASR ASR[i])(17) MDD=c (MDD MDD[i])(18) (19) return (WR ARR ASR MDD)

Algorithm 3 Backtesting algorithm with transaction cost in R language

62 Analysis of Impact of Transaction Cost on the TradingPerformance of SPICS Transaction cost is one of the mostimportant factors affecting trading performance In US stocktrading transparent transaction cost can be charged accord-ing to a fixed fee per order or month or a floating fee basedon the volume and turnover of each transaction Sometimescustomers can also negotiate with broker to determinetransaction cost The transaction cost charged by differentbrokers varies greatly Meanwhile implicit transaction costis not known beforehand and the estimations of them arevery complex Therefore we assume that the percentageof turnover is the transparent transaction cost for ease ofcalculation In the aspect of implicit transaction cost we onlyconsider the impact of slippage on trading performance

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 24 WR is decreasing with the increase oftransaction cost for any trading algorithm which is intuitiveWhen the transaction cost is set to (s c) = (004 0005) theWR of each algorithm is the lowest Compared with setting(s c) = (0 0) the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR and SVM to XGB are reduced by580 597 591 1583 1804 1395 2171 16042216 1854 1850 and 2597 respectively ThereforeMLP DBN and SAE are more tolerant to transaction costGenerally speaking the DNN models have stronger capacityto accommodate transaction cost than the traditional MLmodels From the single trading algorithm such as MLP ifwe do not consider slippage ie s=0 the average WR ofMLP is 05510 under transaction cost structures (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not considertransparent transaction cost ie c=0 the averageWRofMLP

is 05618 under transaction cost structures (s1 c0) (s2 c0)(s3 c0) (s4 c0) so transparent transaction cost has greaterimpact than slippageThroughmultiple comparative analysisthe WR under the transaction cost structure (s1 c0) is notsignificantly different from the WR without transaction costfor MLP DBN and SAETheWR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the WR under the transaction cost structure (s1 c0) (s2 c0) are not significantly different from theWRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 25 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the lowest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 4031 4157 and 4093 respectivelywhile the ARR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin accounts For a general setting of s and c ie (s c) = (0020003) ARR of MLP DBN and SAE decrease by 23262400 and 2361 respectively while the ARR of otheralgorithms decrease by more than 50 and that of CARTand XGB decrease bymore than 100ThereforeMLP DBNand SAE are more tolerant to high transaction cost Fromsingle trading algorithm such as RNN if we do not considerslippage ie s=0 the average ARR of RNN is 01434 under

Mathematical Problems in Engineering 19

Table24Th

eWRof

SPICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

05676

05680

05683

05843

05825

05844

05266

05930

05912

05859

05831

05891

(s0c1)

05615

05618

05621

05669

05626

05694

05052

05752

05663

05654

05630

05599

(s0c2)

05560

05560

05564

05507

05442

05553

04847

05585

05429

05463

05438

05324

(s0c3)

05507

05506

05510

05353

05269

05418

04652

05424

05205

05278

05253

05061

(s0c4)

05457

05454

05460

05206

05101

05289

044

7005277

04996

05105

05084

04818

(s0c5)

05410

05407

05412

05071

04946

05170

04303

05138

04803

04947

04924

04594

(s1c0)

056

49056

53056

5605778

05751

05785

05190

058

61058

2405782

05759

05788

(s1c1)

05594

05597

05600

05619

05571

05648

04991

05700

05597

05595

05574

05521

(s1c2)

05539

05539

05544

05458

05389

05508

04788

05534

05364

05406

05383

05249

(s1c3)

05487

05486

05491

05305

05215

05375

04597

05375

05141

05223

05200

04988

(s1c4)

05438

05436

05441

05163

05052

05249

044

1805231

04938

05054

05034

04750

(s1c5)

05394

05390

05396

05032

04902

05132

04255

05097

04751

04900

04880

04532

(s2c0)

05628

05631

05635

05729

056

9705741

05134

058

1105758

05726

05704

05713

(s2c1)

05573

05574

05578

05568

05515

05602

04931

05647

05527

05535

05515

05442

(s2c2)

05518

05518

05523

05408

05336

05463

04729

05482

05297

05349

05326

05172

(s2c3)

05469

05467

05472

05260

05164

05334

04543

05330

05082

05171

05150

04918

(s2c4)

05421

05417

05423

05120

05004

05209

04368

05187

04881

05004

04986

046

85(s2c5)

05377

05373

05379

04993

04858

05096

04209

05055

04699

04855

04835

044

73(s3c0)

05606

05609

05612

05678

05640

05694

05074

05759

05690

05668

05646

05635

(s3c1)

05552

05553

05558

05518

05460

05556

04872

05595

05460

05478

05459

05365

(s3c2)

05499

05498

05503

05362

05284

05422

046

7505434

05233

05295

05273

05099

(s3c3)

05450

05448

05453

05216

05114

05292

04491

05284

05020

05120

05098

04849

(s3c4)

05405

05401

05407

05080

04960

05172

04321

05146

04827

04959

04940

04622

(s3c5)

05362

05357

05363

04955

04816

05063

04166

05017

04651

04815

04793

044

17(s4c0)

05587

05589

05593

05630

05588

05652

05019

05710

05627

05613

05593

05562

(s4c1)

05533

05533

05537

05470

05407

05513

04815

05544

05395

05424

05404

05290

(s4c2)

05480

05479

05484

05316

05232

05380

04620

05386

05171

05242

05220

05026

(s4c3)

05432

05429

05435

05172

05067

05253

044

4005241

04964

05070

05051

04782

(s4c4)

05388

05384

05391

05041

04917

05137

04274

05106

04775

04914

04897

04564

(s4c5)

05347

05341

05347

04918

04774

05029

04123

04979

046

0204773

04752

04361

20 Mathematical Problems in Engineering

Table25Th

eARR

ofSP

ICSford

ailytradingwith

different

transactioncost

Ther

esultthatthere

isno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

03332

03296

03325

02943

02920

02934

03317

02975

03133

02942

03067

03041

(s0c1)

03128

030

8703118

02439

02327

02521

02266

02496

02384

02336

02400

02137

(s0c2)

02924

02879

02912

01936

01735

02108

01216

02017

01636

01731

01734

01234

(s0c3)

02721

02672

02706

01433

0114

301697

00168

01539

00889

01126

01070

00333

(s0c4)

02519

02464

02500

00931

00553

01285

-00878

01062

00143

00522

004

06-00567

(s0c5)

02316

02257

02294

00430

-00037

00875

-019

2400586

-00602

-0008

-00257

-014

66(s1c0)

03249

03212

03242

027

7802729

02794

029

53028

18028

9802747

028

5502762

(s1c1)

03046

03004

03035

02274

02136

02381

01902

02339

02149

02141

02188

01859

(s1c2)

02842

02796

02829

01771

01544

01969

00853

01861

01401

01536

01523

00957

(s1c3)

02639

02588

02623

01269

00953

01557

-00195

01383

00654

00931

00858

000

56(s1c4)

02437

02381

02417

00767

00363

0114

6-012

41009

06-00091

00328

00195

-00844

(s1c5)

02234

02174

02211

00266

-00226

00735

-02285

00430

-00836

-00275

-0046

8-01742

(s2c0)

03167

03129

03159

026

1302538

026

54025

89026

61026

6302551

026

43024

84(s2c1)

02964

02921

02952

02110

01946

02241

01539

02182

01914

01946

01977

01581

(s2c2)

0276

02713

02746

01607

01354

01829

00490

01704

0116

701341

01312

006

79(s2c3)

02557

02505

02540

0110

400763

01418

-00557

01227

004

2000737

006

47-00221

(s2c4)

02355

02298

02334

006

0300173

01007

-016

0300750

-00325

00134

-00016

-01120

(s2c5)

02153

02091

02129

00102

-00416

00597

-0264

700274

-010

69-00469

-00678

-02018

(s3c0)

030

85030

46030

7602448

02348

02514

02225

02504

02428

02356

02431

02206

(s3c1)

02881

02838

02869

01945

01756

02102

0117

502026

01680

01751

01765

01304

(s3c2)

02678

02630

02663

01442

01164

01690

00127

01548

00933

0114

601100

004

02(s3c3)

02476

02422

02457

00940

00574

01279

-00919

01071

00187

00543

00436

-00498

(s3c4)

02273

02215

02252

00439

-00016

00868

-019

6400595

-00558

-0006

-00227

-013

97(s3c5)

02071

02008

02047

-00062

-0060

5004

58-0300

800119

-013

02-00662

-00889

-02294

(s4c0)

03003

02962

02993

02284

02157

02374

01862

02348

02193

02161

02219

01929

(s4c1)

02799

02754

02786

01781

01565

01962

00813

01870

01445

01556

01554

01026

(s4c2)

02597

02547

02580

01278

00974

01551

-00235

01392

00699

00952

00889

00125

(s4c3)

02394

02339

02375

00776

00384

0114

0-012

8100915

-0004

700349

00226

-00774

(s4c4)

02192

02132

02169

00275

-00205

00729

-02326

00439

-00792

-00254

-00437

-016

73(s4c5)

01989

01926

01964

-00225

-00794

00319

-033

69-00037

-015

35-00856

-010

99-02570

Mathematical Problems in Engineering 21

the transaction cost structures (s0 c1) (s0 c2) (s0 c3) (s0c4) (s0 c5) if we do not consider transparent transactioncost ie c=0 the average ARR of RNN is 02531 under thetransaction cost structure (s1 c0) (s2 c0) (s3 c0) (s4c0) so transparent transaction cost has greater impact thanslippage Through multiple comparative analysis the ARRunder the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s0 c1) are not significantly different from the ARRwithout transaction cost for MLP DBN and SAE the ARRunder all other transaction cost structures are significantlysmaller than theARRwithout transaction cost For all tradingalgorithms except for MLP DBN and SAE the ARR underthe transaction cost structures (s1 c0) (s2 c0) are notsignificantly different from the ARR without transactioncost the ARR under all other transaction cost structures aresignificantly smaller than the ARR without transaction cost

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 26 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theASR of each algorithm is the lowest Compared with settingwithout transaction cost the ASR of MLP DBN and SAEreduce by 3997 4123 and 4066 respectively while theASR of other trading algorithms reduce by more than 90compared with the case of no transaction cost Thereforeexcessive transaction cost will significantly reduce ASR Fora general setting of s and c ie (s c) = (002 0003) theASR of MLP DBN and SAE decrease by 2262 2336and 2302 respectively while the ASR of other algorithmsdecrease by more than 50 the ASR of CART and XGBdecrease by more than 100Therefore MLP DBN and SAEare more tolerant to transaction cost From single tradingalgorithm such as NB if we do not consider slippage ies=0 the average ASR of NB is 08052 under the transactioncost structure (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5)if we do not consider transparent transaction cost ie c=0the average ASR of NB is 14182 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has greater impact than slippage Throughmultiple comparative analysis the ASR under the transactioncost structures (s1 c0) (s2 c0) (s3 c0) (s0 c1) are notsignificantly different from the ASR without transaction costfor MLP DBN and SAE the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the ASR under the transaction cost structures(s1 c0) (s2 c0) are not significantly different from the ASRwithout transaction cost the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 27 MDD increases with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the settings without transaction cost theMDD of MLP DBN and SAE increase by 932 1108 and

1032 respectively The MDD of other trading algorithmsincrease by more than 80 compared with those withoutconsidering transaction costTherefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 483 580 and 533respectively while the MDD of other algorithms increase bymore than 35 and theMDDofCART RF andXGB increasebymore than 100Therefore MLP DBN and SAE are moretolerant to transaction cost As awhole theDNNmodels havestronger capacity to accommodate transaction cost than thetraditional ML models From single trading algorithm suchas GRU if we do not consider slippage ie s=0 the averageMDD of GRU is 04459 under the transaction cost structures(s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do notconsider transparent transaction cost ie c=0 the averageMDD of GRU is 03559 under the transaction cost structures(s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparent transactioncost has greater impact than slippage Through multiplecomparative analysis the MDD under any the transactioncost structure is not significantly different from the MDDwithout transaction cost for MLP DBN and SAE For alltrading algorithms except for MLP DBN and SAE such asLR the MDD under the transaction cost structures (s0 c1)(s1 c0) (s2 c0) (s3 c0) are not significantly different fromthe MDD without transaction cost the MDD under all othertransaction cost structures are significantly greater than theMDD without transaction cost

Through the analysis of the Table 27 performance eval-uation indicators we find that trading performance afterconsidering transaction cost will be worse than that withoutconsidering transaction cost as is in actual trading situationIt is noteworthy that the performance changes of DNNalgorithms especially MLP DBN and SAE are very smallafter considering transaction cost This shows that the threealgorithms have good tolerance to changes of transactioncost Especially for the MDD of the three algorithms thereis no significant difference with that with no transactioncost So we can consider applying them in actual tradingMeanwhile we conclude that the transparent transactioncost has greater impact on the trading performances thanthe slippage for SPICS This is because the prices of SPICSare too high when the transparent transaction cost is setto a certain percentage of turnover In actual transactionsspecial attention needs to be paid to the fact that the trans-action performance under most transaction cost structuresis significantly lower than the trading performance withoutconsidering transaction cost It is worth noting that theperformance of traditional ML algorithm is not worse thanthat ofDNNalgorithmswithout considering transaction costwhile the performance of DNN algorithms is better than thatof traditional ML algorithms after considering transactioncost

63 Analysis of Impact of Transaction Cost on the TradingPerformance of CSICS Similar to Section 62 we will discussthe impact of transaction cost on trading performance ofCSICS in the followings In the Chinese A-share marketthe transparent transaction cost is usually set to a certain

22 Mathematical Problems in Engineering

Table26Th

eASR

ofSP

ICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

1546

815

412

15502

15764

15571

15828

13927

16237

16763

15818

16018

16298

(s0c1)

1456

214

478

14577

1300

012

317

13565

09346

13554

12650

12472

12456

11294

(s0c2)

13639

13527

13635

10191

09015

11262

04657

10822

08482

09074

08846

06236

(s0c3)

12702

12561

12679

07355

05690

08929

-00085

08061

04298

05652

05216

0118

2(s0c4)

11751

11581

11709

04511

02366

06580

-04823

05291

00139

02234

01596

-03812

(s0c5)

1079

10591

10728

01678

-00931

04227

-09500

02534

-039

59-01152

-019

87-08696

(s1c0)

15121

1505

715

149

1492

714

606

15119

1244

915

424

1558

214

825

14974

1488

6(s1c1)

14208

14116

14217

12146

11334

12841

07823

12722

1144

711459

11394

09859

(s1c2)

13279

13159

13270

09325

08020

10526

03105

09977

07267

08048

07772

04792

(s1c3)

12337

12188

12308

064

8204690

08185

-016

4607209

03082

04622

04139

-00257

(s1c4)

11382

11204

11333

03637

01368

05831

-06374

04438

-010

6801208

00524

-052

31(s1c5)

10417

10210

10348

00807

-019

2003478

-110

2501686

-05146

-02169

-0304

7-10083

(s2c0)

1477

1469

914

792

1408

113

632

1440

310

946

1460

114

390

1382

213

922

1346

2(s2c1)

13851

13752

13854

11285

10343

12111

06283

11883

10237

10439

10325

08416

(s2c2)

12916

12789

12901

08454

07021

09785

01547

09128

060

4907019

06696

03346

(s2c3)

11969

11812

11934

05607

03688

07437

-032

0506355

01868

03591

03063

-016

90(s2c4)

11010

10825

10955

02763

00372

05081

-07916

03586

-02268

00183

-00545

-06639

(s2c5)

1004

109827

09967

-0006

-02905

02729

-12533

00841

-06323

-031

79-04101

-114

54(s3c0)

14415

14337

14432

13227

12650

13679

09425

13770

13189

12810

12862

12030

(s3c1)

13490

13384

13488

10419

09348

11375

04733

11039

09023

09413

09252

06971

(s3c2)

12551

12416

12529

07580

060

19090

40-00013

08275

04832

05988

05618

01904

(s3c3)

11599

11435

11558

04731

02688

066

88-04757

05500

00658

02562

01988

-031

16(s3c4)

10636

10443

10575

01891

-00620

04331

-0944

202735

-0346

0-00836

-016

08-08034

(s3c5)

09664

09443

09584

-00924

-03883

01982

-14018

000

00-074

89-04183

-05146

-12808

(s4c0)

14058

13972

1406

812

368

11662

12950

07892

12933

11983

11793

11796

10591

(s4c1)

13127

13013

13119

09549

08350

10634

03180

10190

07807

08386

08177

05527

(s4c2)

12183

1204

12155

06705

05018

08293

-015

6807421

03617

04958

04542

004

68(s4c3)

11226

11055

11179

03857

01691

05938

-06295

046

47-00545

01537

00918

-04529

(s4c4)

1026

1006

10193

01021

-016

0703582

-10948

01888

-0464

2-018

49-02665

-09413

(s4c5)

09286

09057

09199

-017

83-04853

01238

-15478

-00836

-0864

2-05177

-06182

-14142

Mathematical Problems in Engineering 23

Table 27 The MDD of SPICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 03583 03584 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338(s0 c1) 03629 03638 03594 03779 03986 03636 04072 03712 03843 03963 03972 04203(s0 c2) 03677 03695 03647 04302 04707 03968 05168 04127 04842 04729 04787 05735(s0 c3) 03727 03756 03703 04990 05639 04376 06564 04709 06172 05682 05844 07335(s0 c4) 03781 03821 03764 05767 06612 04873 07804 05424 07377 06653 06913 08447(s0 c5) 03839 03890 03828 06529 0746 05444 08730 06162 08272 07501 07808 09118(s1 c0) 03596 03600 03560 03500 036130 03446 03574 03502 03414 03585 03569 03540(s1 c1) 03642 03655 03609 03907 04156 03717 04320 03814 04067 04154 04170 04541(s1 c2) 03691 03712 03662 04466 04936 04066 05534 04270 05172 04971 05049 06168(s1 c3) 03742 03774 03720 05183 05895 04495 06928 04885 06499 05937 06129 07662(s1 c4) 03796 03839 03781 05961 06842 05013 08105 05610 07631 06884 07161 08649(s1 c5) 03856 03909 03847 0671 07646 05595 08946 06342 08451 07691 0800 09235(s2 c0) 03609 03615 03573 03607 03756 03517 03770 03586 03586 03739 03727 03787(s2 c1) 03656 03671 03623 04047 04349 03805 04627 03929 04339 04365 04397 04929(s2 c2) 03705 03729 03678 04642 05176 04171 05916 04424 05504 05218 05327 06577(s2 c3) 03756 03792 03736 05377 06143 04624 07277 05067 06805 06183 06402 07939(s2 c4) 03812 03859 03799 06155 07056 05161 08380 05796 07856 07099 07388 08816(s2 c5) 03873 03930 03866 06887 07816 05751 09126 06517 08606 07864 08172 09331(s3 c0) 03622 03631 03588 03729 03912 03594 04004 03685 03795 03909 03909 04081(s3 c1) 03669 03687 03639 04200 04555 03901 04966 04062 04622 04587 04642 05334(s3 c2) 03719 03746 03694 04826 05423 04286 06295 04589 05833 05465 05607 06936(s3 c3) 03772 03811 03754 05572 06377 04762 07609 05248 07081 06420 06657 08175(s3 c4) 03829 03879 03818 06341 07254 05314 08620 05980 08054 07300 07593 08956(s3 c5) 03894 03954 03888 07056 07972 05909 09275 06689 08740 08022 08325 09412(s4 c0) 03635 03647 03602 03861 04082 03678 04274 03798 04015 04096 04114 04396(s4 c1) 03683 03704 03654 04362 04774 04005 05325 04211 04908 04814 04894 05730(s4 c2) 03734 03765 03712 05013 05664 04410 06667 04758 06142 05707 05875 07253(s4 c3) 03790 03833 03775 05765 06600 04905 07906 05429 07330 06644 06894 08375(s4 c4) 03851 03904 03841 06521 07439 05470 08824 06162 08230 07485 07782 09074(s4 c5) 03917 03981 03913 07218 08115 06067 09395 06857 08858 08165 08463 09480

percentage of turnover and it is the same as the assumptionin the experimental settings As in the US stock market thesmallest unit of price change is 001 (one tick) It is reasonableto set slippage to be 001-005 Of course it should be notedthat the prices fluctuation may be more intense when closingthan that in the middle of a trading day

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 28 the WR is decreasing with the increaseof transaction cost for any trading algorithm When thetransaction cost is set to (s c) = (004 0005) the WR of eachalgorithm is the smallest Comparedwith the settings withouttransaction cost the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR SVM and XGB are reduced by671 688 697 2269 1726 1548 2430 14912484 2112 2112 and 2919 respectively For a generalsetting of s and c ie (s c) = (002 0003) the WR ofMLP DBN and SAE decrease by 410 420 and 430respectively while the WR of other algorithms decrease bymore than 9 the WR of CART RF and XGB decrease by

more than 15 Therefore MLP DBN and SAE are moretolerant to transaction cost From single trading algorithmsuch as LSTM if we do not consider slippage ie s=0 theaverage WR of DBN is 05417 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage WR of LSTM is 05304 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the WR under the transactioncost structures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the WR without transaction cost for MLPDBN SAE and NB the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN SAE and NB the WR under the transaction coststructure (s0 c1) is not significantly different from the WRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

24 Mathematical Problems in Engineering

Table 28 The WR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803(s0 c1) 05523 05527 05525 05525 05608 05620 05009 05227 05612 05665 05571 05595(s0 c2) 05488 05492 05489 05389 05512 05535 04879 05149 05460 05542 05445 05411(s0 c3) 05453 05456 05452 05258 05414 05451 04747 05068 05313 05418 05320 05234(s0 c4) 05417 05419 05414 05127 05320 05368 04622 04991 05172 05297 05202 05067(s0 c5) 05383 05383 05379 05004 05230 05286 04504 04917 05036 05180 05088 04905(s1 c0) 05494 05499 05497 05444 05541 05558 04925 05170 05520 05584 05492 05488(s1 c1) 05456 05459 05456 05286 05424 05456 04775 05080 05342 05437 05345 05275(s1 c2) 05421 05423 05420 05161 05335 05377 04654 05007 05207 05320 05231 05110(s1 c3) 05386 05388 05383 05036 05246 05296 04530 04931 05065 05205 05116 04946(s1 c4) 05353 05354 05349 04915 05156 05218 04419 04861 04937 05095 05007 04795(s1 c5) 05323 05323 05317 04808 05076 05148 04315 04796 04817 04995 04905 04652(s2 c0) 05431 05434 05431 05219 05368 05403 04707 05036 05269 05374 05286 05189(s2 c1) 05395 05397 05393 05078 05266 05314 04573 04956 05115 05242 05154 05005(s2 c2) 05360 05361 05357 04960 05181 05237 04458 04886 04985 05134 05046 04853(s2 c3) 05331 05331 05326 04850 05100 05167 04352 04818 04864 05031 04945 04711(s2 c4) 05300 05300 05293 04743 05018 05093 04252 04752 04746 04931 04846 04572(s2 c5) 05273 05271 05266 04648 04946 05029 04159 04692 04639 04838 04755 04445(s3 c0) 05373 05374 05371 05019 05216 05265 04514 04917 05049 05186 05098 04932(s3 c1) 05341 05341 05336 04902 05128 05188 04399 04846 04917 05074 04990 04775(s3 c2) 05312 05312 05306 04798 05052 05122 04303 04782 04804 04977 04896 04644(s3 c3) 05281 05281 05275 04696 04976 05049 04206 04718 04689 04879 04799 04509(s3 c4) 05252 05251 05245 04598 04901 04984 04110 04657 04581 04785 04707 04378(s3 c5) 05226 05223 05218 04510 04833 04924 04023 04602 04481 04701 04621 04264(s4 c0) 05325 05325 05321 04860 05089 05150 04360 04816 04870 05030 04949 04723(s4 c1) 05294 05294 05289 04753 05010 05079 04258 04750 04752 04928 04849 04588(s4 c2) 05266 05265 05259 04653 04937 05013 04164 04690 04642 04838 04761 04458(s4 c3) 05238 05236 05230 04562 04864 04948 04073 04632 04541 04747 04672 04336(s4 c4) 05211 05208 05203 04475 04798 04891 03985 04577 04440 04662 04586 04218(s4 c5) 05186 05182 05176 04392 04733 04832 03901 04524 04348 04582 04509 04109

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 29 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the smallest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 5073 5175 and 5225 respectivelyWhile the ARR of other trading algorithms decrease bymore than 100 compared with those algorithms withouttransaction cost Therefore excessive transaction cost canlead to serious losses in the accounts For a general settingof s and c ie (s c) = (002 0003) ARR of MLP DBNand SAE decrease by 2741 2797 and 2825 respectivelywhile the ARR other algorithms decrease by more than 50and that of CART NB RF and XGB decrease by more than100 Therefore MLP DBN and SAE are more tolerant totransaction cost From single trading algorithm such as SAEif we do not consider slippage ie s=0 the average ARR ofSAE is 05040 under the transaction cost structure (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not consider

transparent transaction cost ie c=0 the averageARRof SAEis 04468 under the transaction cost structures (s1 c0) (s2c0) (s3 c0) (s4 c0) so transparent transaction cost hassmaller impact than slippage Through multiple comparativeanalysis the ARR under the transaction cost structures (s0c1) (s0 c2) (s0 c3) (s0 c1) (s1 c1) are not significantlydifferent from the ARR without transaction cost for MLPDBN and SAE the ARR under all other transaction coststructures are significantly smaller than the ARR withouttransaction cost For RNN LSTM GRU CART RF LR andSVM the ARR under the transaction cost structures (s0c1) (s0 c2) (s1 c0) are not significantly different fromthe ARR without transaction cost the ARR under all othertransaction cost structures are significantly smaller than theARR without transaction cost For NB and XGB the ARRunder the transaction cost structures (s0 c1) (s1 c0) arenot significantly different from the ARR without transactioncost the ARR under all other transaction cost structuresare significantly smaller than the ARR without transactioncost

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 9: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

Mathematical Problems in Engineering 9

Table 7Multiple comparison analysis between the RR of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 10000 10000 10000LSTM 10000 10000 10000 10000GRU 09999 10000 09999 10000 10000CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00485 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 00555SVM 00000 00000 00000 00000 00000 00000 00197 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00010 09958 00000

Table 8Multiple comparison analysis between the F1 of any two trading algorithms The p value of the two trading strategies with significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 09998SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00810GRU 00000 00000 00000 00000 03489CART 00861 00061 00117 00000 00000 00000NB 00000 00000 00000 04635 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00078 00000LR 00000 00000 00000 00000 00000 00000 00173 00000 10000SVM 00007 00000 00000 00000 00000 00000 09797 00000 03336 04825XGB 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000

Table 9 Multiple comparison analysis between the AUC of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 10000 10000 10000LSTM 10000 10000 10000 09999GRU 10000 10000 10000 10000 09975CART 00000 00000 00000 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00000 00270 00000LR 00000 00000 00000 00000 00000 00000 00000 00000 05428SVM 00000 00000 00000 00000 00000 00000 03125 00000 00000 00000XGB 00000 00000 00000 00000 00000 00000 00000 00000 00002 03954 00000

(5) Through the hypothesis test analysis of H5a and H5bwe can obtain p valuelt22e-16 So there are statisticallysignificant differences between the AUC of all trading algo-rithms Therefore we need to make multiple comparativeanalysis further as shown in Table 9 The number in thetable is a p value of any two algorithms of Nemenyi testFrom Tables 9 and 4 we can see that there is no significantdifference among the AUC of all DNN models The AUC of

all DNN models are significantly smaller than that of anytraditional ML model

(6) Through the hypothesis test analysis of H6a and H6bwe can obtain p valuelt22e-16 So there are statistically sig-nificant differences between theWRof all trading algorithmsTherefore we need to make multiple comparative analysisfurther as shown in Table 10 The number in the table is pvalue of any two algorithms of Nemenyi test From Tables 4

10 Mathematical Problems in Engineering

Table10M

ultip

lecomparis

onanalysisbetweentheW

Rof

anytwotradingalgorithm

sTh

epvalueo

fthe

twotradingstr

ategiesw

ithsig

nificantd

ifference

isin

boldface

Index

BAH

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

BAH

000

00MLP

000

00000

00DBN

000

00000

0010

000

SAE

000

00000

0010

000

1000

0RN

N000

00000

00000

00000

00000

00LSTM

000

00000

00000

00000

00000

0009974

GRU

000

11000

00000

01000

00000

0010

000

09961

CART

000

0009998

000

00000

00000

00000

00000

00000

00NB

000

00000

00000

00000

00000

00000

31000

00000

38000

00RF

000

00000

00000

00000

00000

0000118

000

0100140

000

0010

000

LR000

00000

00000

00000

00000

0010

000

08508

1000

0000

00004

320117

7SV

M000

00000

00000

00000

00000

0010

000

1000

010

000

000

00000

01000

0609780

XGB

000

00000

00000

00000

00000

0002660

000

8402927

000

0009831

09989

07627

00376

Mathematical Problems in Engineering 11

Table 11Multiple comparison analysis between theARRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00001 00006 00001LSTM 00000 00000 00000 00002 00000 10000GRU 00000 00000 00001 00008 00001 10000 10000CART 00000 00000 10000 10000 10000 00001 00000 00001NB 00000 00000 00021 00094 00022 10000 09998 10000 00018RF 00000 00000 07978 09524 08036 01685 00874 01962 07745 05861LR 00000 00000 00002 00012 00002 10000 10000 10000 00002 10000 02408SVM 00000 00000 02375 04806 02427 07029 05214 07457 02178 09778 09999 08015XGB 00000 00000 00674 01856 00694 09423 08466 09576 00600 09996 09905 09739 10000

Table 12Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 09667MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 08763 07617 08998LSTM 00000 00000 09922 09701 09949 10000GRU 00000 00000 06124 04563 06537 10000 09996CART 00000 00000 00002 00005 00002 00000 00000 00000NB 00000 00000 00467 00233 00557 09529 07037 09971 00000RF 00000 00000 00000 00000 00000 00291 00042 01062 00000 08010LR 00000 00000 07506 06025 07859 10000 10000 10000 00000 09872 00602SVM 00000 00000 01759 01020 02010 09982 09399 10000 00000 10000 04671 09998XGB 00000 00000 00099 00044 00122 07548 03776 09470 00000 10000 09681 08791 09997

and 10 we can see that the WR of MLP DBN and SAE haveno significant difference but they are significantly higherthan that of BAH and benchmark index and significantlylower than that of other trading algorithms TheWR of RNNLSTM and GRU have no significant difference but they aresignificantly higher than that of CART and significantly lowerthan that of NB and RF The WR of LR is not significantlydifferent from that of RF SVM and XGB

(7) Through the analysis of the hypothesis test of H7aand H7b we obtain p valuelt22e-16 Therefore there aresignificant differences between the ARR of all trading strate-gies including the benchmark index and BAH We needto do further multiple comparative analysis as shown inTable 11 From Tables 4 and 11 we can see that the ARR ofthe benchmark index and BAH are significantly lower thanthat of all ML algorithms The ARR of MLP DBN and SAEare significantly greater than that of RNN LSTM GRU NBand LR but not significantly different from that of CARTRF SVM and XGB there is no significant difference betweenthe ARR of MLP DBN and SAE The ARR of RNN LSTM

and GRU are significantly less than that of CART but theyare not significantly different from that of other traditionalML algorithms In all traditional ML algorithms the ARR ofCART is significantly greater than that of NB and LR butotherwise there is no significant difference between ARR ofany other two algorithms

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore there are significantdifferences between ASR of all trading strategies includingthe benchmark index and BAH The results of our multiplecomparative analysis are shown in Table 12 From Tables 4and 12 we can see that the ASR of the benchmark index andBAH are significantly smaller than that of all ML algorithmsThe ASR of MLP and DBN are significantly greater than thatof CART and are significantly smaller than that of NB RFand XGB but there is no significant difference between MLPDBN and other algorithms The ASR of SAE is significantlygreater than that of CART and significantly less than that ofRF and XGB but there is no significant difference betweenSAE and other algorithms The ASR of RNN and LSTM

12 Mathematical Problems in Engineering

Table 13 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00052DBN 00000 00031 10000SAE 00000 00012 10000 10000RNN 00000 00000 01645 02243 03556LSTM 00000 00000 06236 07173 08511 10000GRU 00000 00000 00245 00381 00760 10000 09860CART 00000 00000 01496 02057 03309 10000 10000 10000NB 00000 00000 00786 01136 01999 10000 09994 10000 10000RF 00000 00000 00002 00004 00012 08964 04248 09980 09109 09713LR 00000 00000 05451 06428 07935 10000 10000 09933 10000 09998 05015SVM 00000 00000 02433 03194 04734 10000 10000 09999 10000 10000 08155 10000XGB 00000 00000 00103 00167 00360 09998 09462 10000 09999 10000 09998 09685 09989

Table 14 Trading performance of different trading strategies in CSICS Best performance of all trading strategies is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGBAR mdash mdash 05175 05167 05163 05030 04993 04993 05052 05084 05090 05084 05112 05087PR mdash mdash 07548 07436 07439 05414 04964 04956 05022 05109 05128 04967 05695 05026RR mdash mdash 05252 05250 05248 05234 05224 05223 05279 05307 05311 05318 05295 05315F1 mdash mdash 06150 06108 06108 05320 05086 05082 05143 05192 05214 05132 05483 05164AUC mdash mdash 05027 05024 05020 05006 04995 04996 05049 05078 05082 05086 05074 05085WR 05222 05090 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803ARR 00633 02224 05731 05704 05678 05248 05165 05113 05534 06125 04842 05095 05004 04938ASR 02625 04612 14031 14006 13935 14880 15422 15505 12232 11122 14379 15582 14231 14698MDD 04808 06697 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632

are significantly greater than that of CART and significantlyless than that of RF but there is no significant differencebetweenRNN LSTM and other algorithmsTheASRofGRUis significantly greater than that of CART but there is nosignificant difference between GRU and other traditional MLalgorithms In all traditional ML algorithms the ASR of allalgorithms are significantly greater than that of CART butotherwise there is no significant difference between ASR ofany other two algorithms

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between MDD of trading strategies includingthe benchmark index and the BAH The results of multiplecomparative analysis are shown in Table 13 From Tables4 and 13 we can see that MDD of any ML algorithm issignificantly greater than that of the benchmark index butsignificantly smaller than that of BAH strategy The MDDof MLP and DBN are significantly smaller than those ofGRU RF and XGB but there is no significant differencebetween MLP DBN and other algorithms The MDD ofSAE is significantly smaller than that of XGB but there isno significant difference between SAE and other algorithmsOtherwise there is no significant difference betweenMDDofany other two algorithms

In a word the traditional ML algorithms such as NBRF and XGB have good performance in most directional

evaluation indicators such as AR PR and F1 The DNNalgorithms such as MLP have good performance in PR andARR In traditional ML algorithms the ARR of CART RFSVM and XGB are not significantly different from that ofMLP DBN and SAE the ARR of CART is significantlygreater than that of LSTM GRU and RNN but otherwisethe ARR of all traditional ML algorithms are not significantlyworse than that of LSTM GRU and RNN The ASR of alltraditional ML algorithms except CART are not significantlyworse than that of the six DNNmodels even the ASR of NBRF and XGB are significantly greater than that of some DNNalgorithms The MDD of RF and XGB are significantly lessthat of MLP DBN and SAE the MDD of all traditional MLalgorithms are not significantly different from that of LSTMGRU and RNNThe ARR and ASR of all ML algorithms aresignificantly greater than that of BAH and the benchmarkindex the MDD of any ML algorithm is significantly greaterthan that of the benchmark index but significantly less thanthat of BAH strategy

53 Comparative Analysis of Performance of Different TradingStrategies in CSICS The analysis methods of this part aresimilar to Section 52 From Table 14 we can see that the ARPR and F1 of MLP are the greatest in all trading algorithmsThe RR AUC WR and ASR of LR are the greatest inall trading algorithms respectively The ARR of NB is the

Mathematical Problems in Engineering 13

Table 15Multiple comparison analysis between theARof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 01857GRU 00000 00000 00000 04439 10000CART 00000 00000 00000 09765 00024 00131NB 00000 00001 00002 00022 00000 00000 01810RF 00000 00002 00005 00007 00000 00000 00941 10000LR 00000 00000 00000 00076 00000 00000 03454 10000 10000SVM 00217 00766 01309 00000 00000 00000 00003 08314 09352 06360XGB 00000 00001 00001 00025 00000 00000 01930 10000 10000 10000 08168

Table 16Multiple comparison analysis between the PRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 09906 09781NB 00000 00000 00000 00000 01716 01234 08940RF 00000 00000 00000 00000 00319 00205 05271 10000LR 00000 00000 00000 00000 10000 10000 09951 02099 00422SVM 00000 00000 00000 01157 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00000 09922 09811 10000 08836 05086 09960 00000

highest in all trading strategies The MDD of CSI 300 index(benchmark index) is the smallest in all trading strategiesTheWRARR and ASR of all ML algorithms are greater thanthose of the benchmark index and BAH strategy

(1) Through the hypothesis test analysis of H1a and H1bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the AR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 15The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 15 we can see that the AR ofMLPDBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms except for SVM The ARof GRU is significantly smaller than that of all traditional MLalgorithms There is no significant difference between the ARof any two traditional ML algorithms except for CART andSVM

(2) Through the hypothesis test analysis of H2a and H2bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the PR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 16 The number in the tableis a p value of any two algorithms of Nemenyi test FromTables 14 and 16 we can see that the PR of MLP DBN and

SAE are significantly greater than that of all other tradingalgorithms and the PR of MLP DBN and SAE have nosignificant difference The PR of SVM is significantly greaterthan that of all other traditional ML algorithms which haveno significant difference between any two algorithms exceptfor SVM The PR of RNN is significantly greater than thatof all traditional ML algorithms except for SVM The PR ofGRU and LSTM are not significantly different from that of alltraditional ML algorithms except for SVM and LR

(3) Through the hypothesis test analysis of H3a and H3bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the RR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 17 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 17 we can see that the RR of all DNN models arenot significantly different There is no significant differenceamong the RR of all traditional ML algorithms The RR ofRNN GRU and LSTM are significantly smaller than that ofany traditional ML algorithm except for CART

(4) Through the hypothesis test analysis of H4a and H4bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the F1 of all trading algorithms There-fore we need to do further multiple comparative analysis and

14 Mathematical Problems in Engineering

Table 17Multiple comparison analysis between the RRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 09996 09996 10000LSTM 09309 09314 09781 09999GRU 09660 09663 09916 10000 10000CART 09744 09742 09225 05809 01509 02138NB 01093 01088 00574 00075 00004 00007 08861RF 00537 00534 00260 00028 00001 00002 07544 10000LR 00330 00328 00152 00015 00001 00001 06498 10000 10000SVM 03444 03434 02170 00434 00033 00059 09920 10000 09998 09991XGB 00193 00192 00085 00007 00000 00000 05344 10000 10000 10000 09960

Table 18 Multiple comparison analysis between the F1 of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 07211 06670NB 00000 00000 00000 00136 00132 00099 08664RF 00000 00000 00000 00786 00016 00011 05162 10000LR 00000 00000 00000 00000 09440 09208 10000 05675 02181SVM 00000 00000 00000 00178 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00001 03138 02679 10000 09937 08849 09964 00000

Table 19 Multiple comparison analysis between the AUC of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 09999 10000RNN 09945 09985 10000LSTM 05273 06382 09259 09937GRU 08448 09102 09958 10000 10000CART 06921 05835 02356 00801 00014 00096NB 00002 00001 00000 00000 00000 00000 02616RF 00001 00001 00000 00000 00000 00000 02002 10000LR 00000 00000 00000 00000 00000 00000 00930 10000 10000SVM 00027 00014 00001 00000 00000 00000 06454 10000 09999 09980XGB 00000 00000 00000 00000 00000 00000 01257 10000 10000 10000 09993

the results are shown in Table 18The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 18 we can see that the F1 of MLP DBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms There is no significantdifference among traditionalML algorithms except SVM andthe F1 of SVM is significantly greater than that of all othertraditional ML algorithms

(5) Through the hypothesis test analysis of H5a and H5bwe can obtain p valuelt22e-16Therefore there are significantdifferences between theAUCof all trading algorithmsThere-fore we need to do further multiple comparative analysis andthe results are shown in Table 19 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 19 we can see that the AUC of all DNN models haveno significant difference There is no significant difference

Mathematical Problems in Engineering 15

Table 20 Multiple comparison analysis between the WR of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 04117MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00002 00006 00000LSTM 00000 00000 00000 00000 00000 09772GRU 00000 00000 00000 00000 00000 09911 10000CART 09931 00000 00000 00000 00000 00000 00000 00000NB 00031 00000 00001 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00205 06437 05358 00000 00000LR 00000 00000 00000 00000 00000 00010 01611 01105 00000 00000 10000SVM 00000 00000 00000 00000 00000 09914 10000 10000 00000 00000 05322 01090XGB 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000

Table 21Multiple comparison analysis between theARRof any two trading strategiesThepvalue of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00007MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 04790 06355 07182LSTM 00000 00000 02512 03806 04630 10000GRU 00000 00000 02235 03454 04249 10000 10000CART 00000 00000 08301 09217 09542 10000 09999 09998NB 00000 00000 10000 10000 10000 02920 01295 01125 06517RF 00000 00000 00020 00048 00076 08705 09735 09806 05393 00006LR 00000 00000 02058 03222 03995 10000 10000 10000 09996 01019 09845SVM 00000 00000 10000 00803 01114 09993 10000 10000 09659 00165 09999 10000XGB 00000 00000 10000 00333 00484 09916 09997 09998 08789 00057 10000 09999 10000

between the AUC of all traditional ML algorithms TheAUC of all traditional ML algorithms except for CART aresignificantly greater than that of any DNN model There isno significant difference among the AUC ofMLP SAE DBNRNN and CART

(6)Through the hypothesis test analysis of H6a and H6bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the WR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 20 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 20 we can see that the WR of BAH and benchmarkindex have no significant difference but they are significantlysmaller than that of anyML algorithmTheWRofMLPDBNand SAE are significantly smaller than that of the other trad-ing algorithms but there is no significant difference betweenthe WR of MLP DBN and SAE The WR of LSTM andGRU have no significant difference but they are significantlysmaller than that of XGB and significantly greater than that of

CART and NB In traditional MLmodels the WR of NB andCART are significantly smaller than that of other algorithmsThe WR of XGB is significantly greater than that of all otherML algorithms

(7)Through the analysis of the hypothesis test of H7a andH7b we obtain p valuelt22e-16

Therefore there are significant differences between theARR of all trading strategies including the benchmark indexand BAH strategy Therefore we need to do further multiplecomparative analysis and the results are shown in Table 21FromTables 14 and 21 we can see that ARR of the benchmarkindex and BAH are significantly smaller than that of alltrading algorithms The ARR of MLP is significantly higherthan that of RF but there is no significant difference betweenMLP and other algorithms The ARR of SAE and DBN aresignificantly higher than that of RF and XGB but they arenot significantly different fromARR of other algorithms TheARR of NB is significantly higher than that of RF SVMand XGB But otherwise there is no significant difference

16 Mathematical Problems in Engineering

Table 22Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 08877MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 09099 08862 08114LSTM 00000 00000 03460 03080 02239 09999GRU 00000 00000 02132 01853 01270 09981 10000CART 00000 00000 00158 00195 00327 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000 00000 07298RF 00000 00000 10000 10000 10000 09968 07444 05789 00018 00000LR 00000 00000 01181 01003 00650 09879 10000 10000 00000 00000 04044SVM 00000 00000 10000 10000 10000 09849 05952 04238 00042 00000 10000 02704XGB 00000 00000 09937 09902 09746 10000 09878 09532 00001 00000 10000 08723 09998

Table 23 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00006DBN 00000 00004 10000SAE 00000 00023 10000 10000RNN 00000 00000 00320 00421 00111LSTM 00000 00000 00002 00003 00000 09947GRU 00000 00000 00001 00001 00000 09767 10000CART 00000 00000 01238 01538 00521 10000 09241 08305NB 00000 01875 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 01180 01469 00493 10000 09298 08401 10000 00000LR 00000 00000 00001 00002 00000 09881 10000 10000 08821 00000 08898SVM 00000 00000 03285 03839 01701 09999 07011 05424 10000 00000 10000 06216XGB 00000 00000 00308 00405 00106 10000 09951 09783 10000 00000 10000 09890 09998

between any other two algorithms Therefore the ARR ofmost traditional ML models are not significantly worse thanthat of the best DNNmodel

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore There are significantdifferences betweenASRof all trading strategies including thebenchmark index and BAH strategy The results of multiplecomparative analysis are shown in Table 22 From Tables 14and 22 we can see that the ASR of the benchmark indexand BAH are significantly smaller than that of all tradingalgorithms The ASR of all ML algorithms are significantlyhigher than that of CART and NB but there is no significantdifference between the ASR of CART and NB Beyond thatthere is no significant difference between any other twoalgorithms Therefore the ASR of all traditional ML modelsexcept NB and CART are not significantly worse than that ofany DNNmodel

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between the MDD of these trading strategies

including the benchmark index and the BAH strategyThe results of multiple comparative analysis are shown inTable 23 From Tables 14 and 23 we can see that the MDDof the benchmark index is significantly smaller than that ofother trading strategies including BAH strategy TheMDD ofBAH is significantly greater than that of all trading algorithmsexcept NBTheMDDofMLPDBN and SAE are significantlylower than that of NB but significantly higher than thatof RNN LSTM GRU LR and XGB The MDD of NB issignificantly greater than that of all other trading algorithmsBeyond that there is no significant difference between anyother two algorithms Therefore all ML algorithms expectNB especially LSTM RNN GRU LR and XGB can play arole in controlling trading risk

In a word some DNN models such as MLP DBN andSAE have good performance in AR PR and F1 traditionalML algorithms such as LR and XGB have good performanceinAUCandWRTheARRof some traditionalML algorithmssuch as CART NB LR and SVM are not significantlydifferent from that of the six DNN models The ASR of the

Mathematical Problems in Engineering 17

six DNN algorithms are not significantly different from alltraditional ML models except NB and CART The MDD ofLR and XGB are significantly smaller than those of MLPDBN and SAE and are not significantly different fromthat of LSTM GRU and RNN The ARR and ASR of allML algorithms are significantly greater than those of BAHand benchmark index the MDD of all ML algorithms aresignificantly smaller than that of the benchmark index butsignificantly greater than that of BAH strategy

From the above analysis and evaluation we can see thatthe directional evaluation indicators of some DNN modelsare very competitive in CSICS while the indicators of sometraditional ML algorithms have excellent performance inSPICS Whether in SPICS or CSICS the ARR and ASR ofall ML algorithms are significantly greater than that of thebenchmark index and BAH strategy respectively In all MLalgorithms there are always some traditional ML algorithmswhich are not significantly worse than the best DNN modelfor any performance evaluation indicator (ARR ASR andMDD)Therefore if we do not consider transaction cost andother factors affecting trading performance of DNN modelsare alternative but not the best choice when they are appliedto stock trading

In the same period the ARR of any ML algorithm inCSICS is significantly greater than that of the same algorithmin SPICS (p valuelt0001 in theNemenyi test)Meanwhile theMDD of any ML algorithm in CSICS is significantly greaterthan that of the same algorithm in SPICS (p value lt0001in the Nemenyi test) The results show that the quantitativetrading algorithms can more easily obtain excess returns inthe Chinese A-share market but the volatility risk of tradingin Chinese A-share market is significantly higher than that ofthe US stock market in the past 8 years

6 The Impact of Transaction Cost onPerformance of ML Algorithms

Trading cost can affect the profitability of a stock tradingstrategy Transaction cost that can be ignored in long-termstrategies is significantly magnified in daily trading Howevermany algorithmic trading studies assume that transactioncost does not exist ([10 17] etc) In practice frictions suchas transaction cost can distort the market from the perfectmodel in textbooks The cost known prior to trading activityis referred to as transparent such as commissions exchangefees and taxes The costs that has to be estimated are knownas implicit including comprise bid-ask spread latency orslippage and related market impact This section focuses onthe transparent and implicit cost and how do they affecttrading performance in daily trading

61 Experimental Settings and Backtesting Algorithm In thispart the transparent transaction cost is calculated by a certainpercentage of transaction turnover for convenience theimplicit transaction cost is very complicated in calculationand it is necessary to make a reasonable estimate for therandom changes of market environment and stock pricesTherefore we only discuss the impact of slippage on tradingperformance

The transaction cost structures of American stocks aresimilar to that of Chinese A-shares We assume that transpar-ent transaction cost is calculated by a percentage of turnoversuch as less than 05 [40 41] and 02 and 05 in theliterature [42] It is different for the estimation of slippage

In some quantitative trading simulation software such asJoinQuant [43] and Abuquant [44] the slippage is set to 002The transparent transaction cost and implicit transaction costare charged in both directions when buying and selling Itis worth noting that the transparent transaction cost varieswith the different brokers while the implicit transaction costis related to market liquidity market information networkstatus trading software etc

We set slippages s = s0=0 s1=001 s2=002 s3=003s4=004 the transparent transaction cost c = c0=0 c1=0001c2=0002 c3=0003 c4=0004 c5=0005 For different s ccombinations we study the impact of different transactioncost structures on trading performance We assume thatbuying and selling positions are one unit so the turnover isthe corresponding stock price When buying stocks we notonly need to pay a certain percentage cost of the purchaseprice but also need to pay an uncertain slippage cost Thatis we need to pay a higher price than the real-time price119875119905minus1

when we are buying But when selling stocks we notonly need to pay a certain percentage cost of the sellingprice but also to pay an uncertain slippage cost Generallyspeaking we need to sell at a price lower than the real-timeprice 119875

119905 It is worth noting that our trading strategy is self-

financing If ML algorithms predict the continuous occur-rence of buying signals or selling signals ie |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 0 we will continue to hold or do nothingso the transaction cost at this time is 0 when |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 1 it is indicated that the position maybe changed from holding to selling or from empty positionto buying At this time we would pay transaction costdue to the trading operation Finally we get a real yieldis

119877119890119905119905le119862119897119900119904119890119875119903119894119888119890

119905minus 119862119897119900119904119890119875119903119894119888119890

119905minus1

119862119897119900119904119890119875119903119894119888119890119905minus1

119875119905= 119862119897119900119904119890119875119903119894119888119890

119905

lowast (1 minus 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816)

minus 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816

119875119905minus1

= 119862119897119900119904119890119875119903119894119888119890119905minus1

lowast (1 + 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816)

+ 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816

119877119890119905119905=119875119905minus 119875119905minus1

119875119905minus1

(5)

where 119862119897119900119904119890119875119903119894119888119890119905

denotes the 119905-th closing price119879119903119886119889119890119878119894119892119899119886119897

119905denotes the 119905-th trading signal 119875

119905denotes

the 119905-th executing price and 119877119890119905119905denotes the 119905-th return rate

We propose a backtesting algorithm with transaction costbased on the above analysis as is shown in Algorithm 3

18 Mathematical Problems in Engineering

Input TS TS is trading signals of a stocks s is slippagec c is transparent transaction cost

Output WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) WR=NULL ARR=NULL ASR=NULL MDD=NULL(3) for (i in 1 N) (4) Stock Data=Stock Code List[i](5) ClosePricet=Stock Data [ldquoClosing Pricerdquo](6) Pt =ClosePricet lowast(1-clowastabs(TSt-TSt-1)) - slowastabs(TSt-TSt-1)(7) Pt-1 =ClosePricetlowast(1+clowastabs(TSt-TSt-1)) + slowastabs(TSt-TSt-1)(8) Rett= (Pt- Pt-1) Pt Ret is the return rate series(9) TDRR=lag (TS)lowastRet TDRR is the daily return through trading(10) WR[i]=sum (TDRRgt0)sum(TDRR =0)(11) ARR[i]=Returnannualized (TDRR)(12) ASR[i]=SharpeRatioannualized (TDRR)(13) MDD[i]=maxDrawDown (TDRR)(14) WR=c (WR WR[i])(15) ARR=c (ARR ARR[i])(16) ASR=c (ASR ASR[i])(17) MDD=c (MDD MDD[i])(18) (19) return (WR ARR ASR MDD)

Algorithm 3 Backtesting algorithm with transaction cost in R language

62 Analysis of Impact of Transaction Cost on the TradingPerformance of SPICS Transaction cost is one of the mostimportant factors affecting trading performance In US stocktrading transparent transaction cost can be charged accord-ing to a fixed fee per order or month or a floating fee basedon the volume and turnover of each transaction Sometimescustomers can also negotiate with broker to determinetransaction cost The transaction cost charged by differentbrokers varies greatly Meanwhile implicit transaction costis not known beforehand and the estimations of them arevery complex Therefore we assume that the percentageof turnover is the transparent transaction cost for ease ofcalculation In the aspect of implicit transaction cost we onlyconsider the impact of slippage on trading performance

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 24 WR is decreasing with the increase oftransaction cost for any trading algorithm which is intuitiveWhen the transaction cost is set to (s c) = (004 0005) theWR of each algorithm is the lowest Compared with setting(s c) = (0 0) the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR and SVM to XGB are reduced by580 597 591 1583 1804 1395 2171 16042216 1854 1850 and 2597 respectively ThereforeMLP DBN and SAE are more tolerant to transaction costGenerally speaking the DNN models have stronger capacityto accommodate transaction cost than the traditional MLmodels From the single trading algorithm such as MLP ifwe do not consider slippage ie s=0 the average WR ofMLP is 05510 under transaction cost structures (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not considertransparent transaction cost ie c=0 the averageWRofMLP

is 05618 under transaction cost structures (s1 c0) (s2 c0)(s3 c0) (s4 c0) so transparent transaction cost has greaterimpact than slippageThroughmultiple comparative analysisthe WR under the transaction cost structure (s1 c0) is notsignificantly different from the WR without transaction costfor MLP DBN and SAETheWR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the WR under the transaction cost structure (s1 c0) (s2 c0) are not significantly different from theWRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 25 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the lowest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 4031 4157 and 4093 respectivelywhile the ARR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin accounts For a general setting of s and c ie (s c) = (0020003) ARR of MLP DBN and SAE decrease by 23262400 and 2361 respectively while the ARR of otheralgorithms decrease by more than 50 and that of CARTand XGB decrease bymore than 100ThereforeMLP DBNand SAE are more tolerant to high transaction cost Fromsingle trading algorithm such as RNN if we do not considerslippage ie s=0 the average ARR of RNN is 01434 under

Mathematical Problems in Engineering 19

Table24Th

eWRof

SPICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

05676

05680

05683

05843

05825

05844

05266

05930

05912

05859

05831

05891

(s0c1)

05615

05618

05621

05669

05626

05694

05052

05752

05663

05654

05630

05599

(s0c2)

05560

05560

05564

05507

05442

05553

04847

05585

05429

05463

05438

05324

(s0c3)

05507

05506

05510

05353

05269

05418

04652

05424

05205

05278

05253

05061

(s0c4)

05457

05454

05460

05206

05101

05289

044

7005277

04996

05105

05084

04818

(s0c5)

05410

05407

05412

05071

04946

05170

04303

05138

04803

04947

04924

04594

(s1c0)

056

49056

53056

5605778

05751

05785

05190

058

61058

2405782

05759

05788

(s1c1)

05594

05597

05600

05619

05571

05648

04991

05700

05597

05595

05574

05521

(s1c2)

05539

05539

05544

05458

05389

05508

04788

05534

05364

05406

05383

05249

(s1c3)

05487

05486

05491

05305

05215

05375

04597

05375

05141

05223

05200

04988

(s1c4)

05438

05436

05441

05163

05052

05249

044

1805231

04938

05054

05034

04750

(s1c5)

05394

05390

05396

05032

04902

05132

04255

05097

04751

04900

04880

04532

(s2c0)

05628

05631

05635

05729

056

9705741

05134

058

1105758

05726

05704

05713

(s2c1)

05573

05574

05578

05568

05515

05602

04931

05647

05527

05535

05515

05442

(s2c2)

05518

05518

05523

05408

05336

05463

04729

05482

05297

05349

05326

05172

(s2c3)

05469

05467

05472

05260

05164

05334

04543

05330

05082

05171

05150

04918

(s2c4)

05421

05417

05423

05120

05004

05209

04368

05187

04881

05004

04986

046

85(s2c5)

05377

05373

05379

04993

04858

05096

04209

05055

04699

04855

04835

044

73(s3c0)

05606

05609

05612

05678

05640

05694

05074

05759

05690

05668

05646

05635

(s3c1)

05552

05553

05558

05518

05460

05556

04872

05595

05460

05478

05459

05365

(s3c2)

05499

05498

05503

05362

05284

05422

046

7505434

05233

05295

05273

05099

(s3c3)

05450

05448

05453

05216

05114

05292

04491

05284

05020

05120

05098

04849

(s3c4)

05405

05401

05407

05080

04960

05172

04321

05146

04827

04959

04940

04622

(s3c5)

05362

05357

05363

04955

04816

05063

04166

05017

04651

04815

04793

044

17(s4c0)

05587

05589

05593

05630

05588

05652

05019

05710

05627

05613

05593

05562

(s4c1)

05533

05533

05537

05470

05407

05513

04815

05544

05395

05424

05404

05290

(s4c2)

05480

05479

05484

05316

05232

05380

04620

05386

05171

05242

05220

05026

(s4c3)

05432

05429

05435

05172

05067

05253

044

4005241

04964

05070

05051

04782

(s4c4)

05388

05384

05391

05041

04917

05137

04274

05106

04775

04914

04897

04564

(s4c5)

05347

05341

05347

04918

04774

05029

04123

04979

046

0204773

04752

04361

20 Mathematical Problems in Engineering

Table25Th

eARR

ofSP

ICSford

ailytradingwith

different

transactioncost

Ther

esultthatthere

isno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

03332

03296

03325

02943

02920

02934

03317

02975

03133

02942

03067

03041

(s0c1)

03128

030

8703118

02439

02327

02521

02266

02496

02384

02336

02400

02137

(s0c2)

02924

02879

02912

01936

01735

02108

01216

02017

01636

01731

01734

01234

(s0c3)

02721

02672

02706

01433

0114

301697

00168

01539

00889

01126

01070

00333

(s0c4)

02519

02464

02500

00931

00553

01285

-00878

01062

00143

00522

004

06-00567

(s0c5)

02316

02257

02294

00430

-00037

00875

-019

2400586

-00602

-0008

-00257

-014

66(s1c0)

03249

03212

03242

027

7802729

02794

029

53028

18028

9802747

028

5502762

(s1c1)

03046

03004

03035

02274

02136

02381

01902

02339

02149

02141

02188

01859

(s1c2)

02842

02796

02829

01771

01544

01969

00853

01861

01401

01536

01523

00957

(s1c3)

02639

02588

02623

01269

00953

01557

-00195

01383

00654

00931

00858

000

56(s1c4)

02437

02381

02417

00767

00363

0114

6-012

41009

06-00091

00328

00195

-00844

(s1c5)

02234

02174

02211

00266

-00226

00735

-02285

00430

-00836

-00275

-0046

8-01742

(s2c0)

03167

03129

03159

026

1302538

026

54025

89026

61026

6302551

026

43024

84(s2c1)

02964

02921

02952

02110

01946

02241

01539

02182

01914

01946

01977

01581

(s2c2)

0276

02713

02746

01607

01354

01829

00490

01704

0116

701341

01312

006

79(s2c3)

02557

02505

02540

0110

400763

01418

-00557

01227

004

2000737

006

47-00221

(s2c4)

02355

02298

02334

006

0300173

01007

-016

0300750

-00325

00134

-00016

-01120

(s2c5)

02153

02091

02129

00102

-00416

00597

-0264

700274

-010

69-00469

-00678

-02018

(s3c0)

030

85030

46030

7602448

02348

02514

02225

02504

02428

02356

02431

02206

(s3c1)

02881

02838

02869

01945

01756

02102

0117

502026

01680

01751

01765

01304

(s3c2)

02678

02630

02663

01442

01164

01690

00127

01548

00933

0114

601100

004

02(s3c3)

02476

02422

02457

00940

00574

01279

-00919

01071

00187

00543

00436

-00498

(s3c4)

02273

02215

02252

00439

-00016

00868

-019

6400595

-00558

-0006

-00227

-013

97(s3c5)

02071

02008

02047

-00062

-0060

5004

58-0300

800119

-013

02-00662

-00889

-02294

(s4c0)

03003

02962

02993

02284

02157

02374

01862

02348

02193

02161

02219

01929

(s4c1)

02799

02754

02786

01781

01565

01962

00813

01870

01445

01556

01554

01026

(s4c2)

02597

02547

02580

01278

00974

01551

-00235

01392

00699

00952

00889

00125

(s4c3)

02394

02339

02375

00776

00384

0114

0-012

8100915

-0004

700349

00226

-00774

(s4c4)

02192

02132

02169

00275

-00205

00729

-02326

00439

-00792

-00254

-00437

-016

73(s4c5)

01989

01926

01964

-00225

-00794

00319

-033

69-00037

-015

35-00856

-010

99-02570

Mathematical Problems in Engineering 21

the transaction cost structures (s0 c1) (s0 c2) (s0 c3) (s0c4) (s0 c5) if we do not consider transparent transactioncost ie c=0 the average ARR of RNN is 02531 under thetransaction cost structure (s1 c0) (s2 c0) (s3 c0) (s4c0) so transparent transaction cost has greater impact thanslippage Through multiple comparative analysis the ARRunder the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s0 c1) are not significantly different from the ARRwithout transaction cost for MLP DBN and SAE the ARRunder all other transaction cost structures are significantlysmaller than theARRwithout transaction cost For all tradingalgorithms except for MLP DBN and SAE the ARR underthe transaction cost structures (s1 c0) (s2 c0) are notsignificantly different from the ARR without transactioncost the ARR under all other transaction cost structures aresignificantly smaller than the ARR without transaction cost

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 26 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theASR of each algorithm is the lowest Compared with settingwithout transaction cost the ASR of MLP DBN and SAEreduce by 3997 4123 and 4066 respectively while theASR of other trading algorithms reduce by more than 90compared with the case of no transaction cost Thereforeexcessive transaction cost will significantly reduce ASR Fora general setting of s and c ie (s c) = (002 0003) theASR of MLP DBN and SAE decrease by 2262 2336and 2302 respectively while the ASR of other algorithmsdecrease by more than 50 the ASR of CART and XGBdecrease by more than 100Therefore MLP DBN and SAEare more tolerant to transaction cost From single tradingalgorithm such as NB if we do not consider slippage ies=0 the average ASR of NB is 08052 under the transactioncost structure (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5)if we do not consider transparent transaction cost ie c=0the average ASR of NB is 14182 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has greater impact than slippage Throughmultiple comparative analysis the ASR under the transactioncost structures (s1 c0) (s2 c0) (s3 c0) (s0 c1) are notsignificantly different from the ASR without transaction costfor MLP DBN and SAE the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the ASR under the transaction cost structures(s1 c0) (s2 c0) are not significantly different from the ASRwithout transaction cost the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 27 MDD increases with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the settings without transaction cost theMDD of MLP DBN and SAE increase by 932 1108 and

1032 respectively The MDD of other trading algorithmsincrease by more than 80 compared with those withoutconsidering transaction costTherefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 483 580 and 533respectively while the MDD of other algorithms increase bymore than 35 and theMDDofCART RF andXGB increasebymore than 100Therefore MLP DBN and SAE are moretolerant to transaction cost As awhole theDNNmodels havestronger capacity to accommodate transaction cost than thetraditional ML models From single trading algorithm suchas GRU if we do not consider slippage ie s=0 the averageMDD of GRU is 04459 under the transaction cost structures(s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do notconsider transparent transaction cost ie c=0 the averageMDD of GRU is 03559 under the transaction cost structures(s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparent transactioncost has greater impact than slippage Through multiplecomparative analysis the MDD under any the transactioncost structure is not significantly different from the MDDwithout transaction cost for MLP DBN and SAE For alltrading algorithms except for MLP DBN and SAE such asLR the MDD under the transaction cost structures (s0 c1)(s1 c0) (s2 c0) (s3 c0) are not significantly different fromthe MDD without transaction cost the MDD under all othertransaction cost structures are significantly greater than theMDD without transaction cost

Through the analysis of the Table 27 performance eval-uation indicators we find that trading performance afterconsidering transaction cost will be worse than that withoutconsidering transaction cost as is in actual trading situationIt is noteworthy that the performance changes of DNNalgorithms especially MLP DBN and SAE are very smallafter considering transaction cost This shows that the threealgorithms have good tolerance to changes of transactioncost Especially for the MDD of the three algorithms thereis no significant difference with that with no transactioncost So we can consider applying them in actual tradingMeanwhile we conclude that the transparent transactioncost has greater impact on the trading performances thanthe slippage for SPICS This is because the prices of SPICSare too high when the transparent transaction cost is setto a certain percentage of turnover In actual transactionsspecial attention needs to be paid to the fact that the trans-action performance under most transaction cost structuresis significantly lower than the trading performance withoutconsidering transaction cost It is worth noting that theperformance of traditional ML algorithm is not worse thanthat ofDNNalgorithmswithout considering transaction costwhile the performance of DNN algorithms is better than thatof traditional ML algorithms after considering transactioncost

63 Analysis of Impact of Transaction Cost on the TradingPerformance of CSICS Similar to Section 62 we will discussthe impact of transaction cost on trading performance ofCSICS in the followings In the Chinese A-share marketthe transparent transaction cost is usually set to a certain

22 Mathematical Problems in Engineering

Table26Th

eASR

ofSP

ICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

1546

815

412

15502

15764

15571

15828

13927

16237

16763

15818

16018

16298

(s0c1)

1456

214

478

14577

1300

012

317

13565

09346

13554

12650

12472

12456

11294

(s0c2)

13639

13527

13635

10191

09015

11262

04657

10822

08482

09074

08846

06236

(s0c3)

12702

12561

12679

07355

05690

08929

-00085

08061

04298

05652

05216

0118

2(s0c4)

11751

11581

11709

04511

02366

06580

-04823

05291

00139

02234

01596

-03812

(s0c5)

1079

10591

10728

01678

-00931

04227

-09500

02534

-039

59-01152

-019

87-08696

(s1c0)

15121

1505

715

149

1492

714

606

15119

1244

915

424

1558

214

825

14974

1488

6(s1c1)

14208

14116

14217

12146

11334

12841

07823

12722

1144

711459

11394

09859

(s1c2)

13279

13159

13270

09325

08020

10526

03105

09977

07267

08048

07772

04792

(s1c3)

12337

12188

12308

064

8204690

08185

-016

4607209

03082

04622

04139

-00257

(s1c4)

11382

11204

11333

03637

01368

05831

-06374

04438

-010

6801208

00524

-052

31(s1c5)

10417

10210

10348

00807

-019

2003478

-110

2501686

-05146

-02169

-0304

7-10083

(s2c0)

1477

1469

914

792

1408

113

632

1440

310

946

1460

114

390

1382

213

922

1346

2(s2c1)

13851

13752

13854

11285

10343

12111

06283

11883

10237

10439

10325

08416

(s2c2)

12916

12789

12901

08454

07021

09785

01547

09128

060

4907019

06696

03346

(s2c3)

11969

11812

11934

05607

03688

07437

-032

0506355

01868

03591

03063

-016

90(s2c4)

11010

10825

10955

02763

00372

05081

-07916

03586

-02268

00183

-00545

-06639

(s2c5)

1004

109827

09967

-0006

-02905

02729

-12533

00841

-06323

-031

79-04101

-114

54(s3c0)

14415

14337

14432

13227

12650

13679

09425

13770

13189

12810

12862

12030

(s3c1)

13490

13384

13488

10419

09348

11375

04733

11039

09023

09413

09252

06971

(s3c2)

12551

12416

12529

07580

060

19090

40-00013

08275

04832

05988

05618

01904

(s3c3)

11599

11435

11558

04731

02688

066

88-04757

05500

00658

02562

01988

-031

16(s3c4)

10636

10443

10575

01891

-00620

04331

-0944

202735

-0346

0-00836

-016

08-08034

(s3c5)

09664

09443

09584

-00924

-03883

01982

-14018

000

00-074

89-04183

-05146

-12808

(s4c0)

14058

13972

1406

812

368

11662

12950

07892

12933

11983

11793

11796

10591

(s4c1)

13127

13013

13119

09549

08350

10634

03180

10190

07807

08386

08177

05527

(s4c2)

12183

1204

12155

06705

05018

08293

-015

6807421

03617

04958

04542

004

68(s4c3)

11226

11055

11179

03857

01691

05938

-06295

046

47-00545

01537

00918

-04529

(s4c4)

1026

1006

10193

01021

-016

0703582

-10948

01888

-0464

2-018

49-02665

-09413

(s4c5)

09286

09057

09199

-017

83-04853

01238

-15478

-00836

-0864

2-05177

-06182

-14142

Mathematical Problems in Engineering 23

Table 27 The MDD of SPICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 03583 03584 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338(s0 c1) 03629 03638 03594 03779 03986 03636 04072 03712 03843 03963 03972 04203(s0 c2) 03677 03695 03647 04302 04707 03968 05168 04127 04842 04729 04787 05735(s0 c3) 03727 03756 03703 04990 05639 04376 06564 04709 06172 05682 05844 07335(s0 c4) 03781 03821 03764 05767 06612 04873 07804 05424 07377 06653 06913 08447(s0 c5) 03839 03890 03828 06529 0746 05444 08730 06162 08272 07501 07808 09118(s1 c0) 03596 03600 03560 03500 036130 03446 03574 03502 03414 03585 03569 03540(s1 c1) 03642 03655 03609 03907 04156 03717 04320 03814 04067 04154 04170 04541(s1 c2) 03691 03712 03662 04466 04936 04066 05534 04270 05172 04971 05049 06168(s1 c3) 03742 03774 03720 05183 05895 04495 06928 04885 06499 05937 06129 07662(s1 c4) 03796 03839 03781 05961 06842 05013 08105 05610 07631 06884 07161 08649(s1 c5) 03856 03909 03847 0671 07646 05595 08946 06342 08451 07691 0800 09235(s2 c0) 03609 03615 03573 03607 03756 03517 03770 03586 03586 03739 03727 03787(s2 c1) 03656 03671 03623 04047 04349 03805 04627 03929 04339 04365 04397 04929(s2 c2) 03705 03729 03678 04642 05176 04171 05916 04424 05504 05218 05327 06577(s2 c3) 03756 03792 03736 05377 06143 04624 07277 05067 06805 06183 06402 07939(s2 c4) 03812 03859 03799 06155 07056 05161 08380 05796 07856 07099 07388 08816(s2 c5) 03873 03930 03866 06887 07816 05751 09126 06517 08606 07864 08172 09331(s3 c0) 03622 03631 03588 03729 03912 03594 04004 03685 03795 03909 03909 04081(s3 c1) 03669 03687 03639 04200 04555 03901 04966 04062 04622 04587 04642 05334(s3 c2) 03719 03746 03694 04826 05423 04286 06295 04589 05833 05465 05607 06936(s3 c3) 03772 03811 03754 05572 06377 04762 07609 05248 07081 06420 06657 08175(s3 c4) 03829 03879 03818 06341 07254 05314 08620 05980 08054 07300 07593 08956(s3 c5) 03894 03954 03888 07056 07972 05909 09275 06689 08740 08022 08325 09412(s4 c0) 03635 03647 03602 03861 04082 03678 04274 03798 04015 04096 04114 04396(s4 c1) 03683 03704 03654 04362 04774 04005 05325 04211 04908 04814 04894 05730(s4 c2) 03734 03765 03712 05013 05664 04410 06667 04758 06142 05707 05875 07253(s4 c3) 03790 03833 03775 05765 06600 04905 07906 05429 07330 06644 06894 08375(s4 c4) 03851 03904 03841 06521 07439 05470 08824 06162 08230 07485 07782 09074(s4 c5) 03917 03981 03913 07218 08115 06067 09395 06857 08858 08165 08463 09480

percentage of turnover and it is the same as the assumptionin the experimental settings As in the US stock market thesmallest unit of price change is 001 (one tick) It is reasonableto set slippage to be 001-005 Of course it should be notedthat the prices fluctuation may be more intense when closingthan that in the middle of a trading day

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 28 the WR is decreasing with the increaseof transaction cost for any trading algorithm When thetransaction cost is set to (s c) = (004 0005) the WR of eachalgorithm is the smallest Comparedwith the settings withouttransaction cost the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR SVM and XGB are reduced by671 688 697 2269 1726 1548 2430 14912484 2112 2112 and 2919 respectively For a generalsetting of s and c ie (s c) = (002 0003) the WR ofMLP DBN and SAE decrease by 410 420 and 430respectively while the WR of other algorithms decrease bymore than 9 the WR of CART RF and XGB decrease by

more than 15 Therefore MLP DBN and SAE are moretolerant to transaction cost From single trading algorithmsuch as LSTM if we do not consider slippage ie s=0 theaverage WR of DBN is 05417 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage WR of LSTM is 05304 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the WR under the transactioncost structures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the WR without transaction cost for MLPDBN SAE and NB the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN SAE and NB the WR under the transaction coststructure (s0 c1) is not significantly different from the WRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

24 Mathematical Problems in Engineering

Table 28 The WR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803(s0 c1) 05523 05527 05525 05525 05608 05620 05009 05227 05612 05665 05571 05595(s0 c2) 05488 05492 05489 05389 05512 05535 04879 05149 05460 05542 05445 05411(s0 c3) 05453 05456 05452 05258 05414 05451 04747 05068 05313 05418 05320 05234(s0 c4) 05417 05419 05414 05127 05320 05368 04622 04991 05172 05297 05202 05067(s0 c5) 05383 05383 05379 05004 05230 05286 04504 04917 05036 05180 05088 04905(s1 c0) 05494 05499 05497 05444 05541 05558 04925 05170 05520 05584 05492 05488(s1 c1) 05456 05459 05456 05286 05424 05456 04775 05080 05342 05437 05345 05275(s1 c2) 05421 05423 05420 05161 05335 05377 04654 05007 05207 05320 05231 05110(s1 c3) 05386 05388 05383 05036 05246 05296 04530 04931 05065 05205 05116 04946(s1 c4) 05353 05354 05349 04915 05156 05218 04419 04861 04937 05095 05007 04795(s1 c5) 05323 05323 05317 04808 05076 05148 04315 04796 04817 04995 04905 04652(s2 c0) 05431 05434 05431 05219 05368 05403 04707 05036 05269 05374 05286 05189(s2 c1) 05395 05397 05393 05078 05266 05314 04573 04956 05115 05242 05154 05005(s2 c2) 05360 05361 05357 04960 05181 05237 04458 04886 04985 05134 05046 04853(s2 c3) 05331 05331 05326 04850 05100 05167 04352 04818 04864 05031 04945 04711(s2 c4) 05300 05300 05293 04743 05018 05093 04252 04752 04746 04931 04846 04572(s2 c5) 05273 05271 05266 04648 04946 05029 04159 04692 04639 04838 04755 04445(s3 c0) 05373 05374 05371 05019 05216 05265 04514 04917 05049 05186 05098 04932(s3 c1) 05341 05341 05336 04902 05128 05188 04399 04846 04917 05074 04990 04775(s3 c2) 05312 05312 05306 04798 05052 05122 04303 04782 04804 04977 04896 04644(s3 c3) 05281 05281 05275 04696 04976 05049 04206 04718 04689 04879 04799 04509(s3 c4) 05252 05251 05245 04598 04901 04984 04110 04657 04581 04785 04707 04378(s3 c5) 05226 05223 05218 04510 04833 04924 04023 04602 04481 04701 04621 04264(s4 c0) 05325 05325 05321 04860 05089 05150 04360 04816 04870 05030 04949 04723(s4 c1) 05294 05294 05289 04753 05010 05079 04258 04750 04752 04928 04849 04588(s4 c2) 05266 05265 05259 04653 04937 05013 04164 04690 04642 04838 04761 04458(s4 c3) 05238 05236 05230 04562 04864 04948 04073 04632 04541 04747 04672 04336(s4 c4) 05211 05208 05203 04475 04798 04891 03985 04577 04440 04662 04586 04218(s4 c5) 05186 05182 05176 04392 04733 04832 03901 04524 04348 04582 04509 04109

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 29 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the smallest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 5073 5175 and 5225 respectivelyWhile the ARR of other trading algorithms decrease bymore than 100 compared with those algorithms withouttransaction cost Therefore excessive transaction cost canlead to serious losses in the accounts For a general settingof s and c ie (s c) = (002 0003) ARR of MLP DBNand SAE decrease by 2741 2797 and 2825 respectivelywhile the ARR other algorithms decrease by more than 50and that of CART NB RF and XGB decrease by more than100 Therefore MLP DBN and SAE are more tolerant totransaction cost From single trading algorithm such as SAEif we do not consider slippage ie s=0 the average ARR ofSAE is 05040 under the transaction cost structure (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not consider

transparent transaction cost ie c=0 the averageARRof SAEis 04468 under the transaction cost structures (s1 c0) (s2c0) (s3 c0) (s4 c0) so transparent transaction cost hassmaller impact than slippage Through multiple comparativeanalysis the ARR under the transaction cost structures (s0c1) (s0 c2) (s0 c3) (s0 c1) (s1 c1) are not significantlydifferent from the ARR without transaction cost for MLPDBN and SAE the ARR under all other transaction coststructures are significantly smaller than the ARR withouttransaction cost For RNN LSTM GRU CART RF LR andSVM the ARR under the transaction cost structures (s0c1) (s0 c2) (s1 c0) are not significantly different fromthe ARR without transaction cost the ARR under all othertransaction cost structures are significantly smaller than theARR without transaction cost For NB and XGB the ARRunder the transaction cost structures (s0 c1) (s1 c0) arenot significantly different from the ARR without transactioncost the ARR under all other transaction cost structuresare significantly smaller than the ARR without transactioncost

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 10: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

10 Mathematical Problems in Engineering

Table10M

ultip

lecomparis

onanalysisbetweentheW

Rof

anytwotradingalgorithm

sTh

epvalueo

fthe

twotradingstr

ategiesw

ithsig

nificantd

ifference

isin

boldface

Index

BAH

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

BAH

000

00MLP

000

00000

00DBN

000

00000

0010

000

SAE

000

00000

0010

000

1000

0RN

N000

00000

00000

00000

00000

00LSTM

000

00000

00000

00000

00000

0009974

GRU

000

11000

00000

01000

00000

0010

000

09961

CART

000

0009998

000

00000

00000

00000

00000

00000

00NB

000

00000

00000

00000

00000

00000

31000

00000

38000

00RF

000

00000

00000

00000

00000

0000118

000

0100140

000

0010

000

LR000

00000

00000

00000

00000

0010

000

08508

1000

0000

00004

320117

7SV

M000

00000

00000

00000

00000

0010

000

1000

010

000

000

00000

01000

0609780

XGB

000

00000

00000

00000

00000

0002660

000

8402927

000

0009831

09989

07627

00376

Mathematical Problems in Engineering 11

Table 11Multiple comparison analysis between theARRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00001 00006 00001LSTM 00000 00000 00000 00002 00000 10000GRU 00000 00000 00001 00008 00001 10000 10000CART 00000 00000 10000 10000 10000 00001 00000 00001NB 00000 00000 00021 00094 00022 10000 09998 10000 00018RF 00000 00000 07978 09524 08036 01685 00874 01962 07745 05861LR 00000 00000 00002 00012 00002 10000 10000 10000 00002 10000 02408SVM 00000 00000 02375 04806 02427 07029 05214 07457 02178 09778 09999 08015XGB 00000 00000 00674 01856 00694 09423 08466 09576 00600 09996 09905 09739 10000

Table 12Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 09667MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 08763 07617 08998LSTM 00000 00000 09922 09701 09949 10000GRU 00000 00000 06124 04563 06537 10000 09996CART 00000 00000 00002 00005 00002 00000 00000 00000NB 00000 00000 00467 00233 00557 09529 07037 09971 00000RF 00000 00000 00000 00000 00000 00291 00042 01062 00000 08010LR 00000 00000 07506 06025 07859 10000 10000 10000 00000 09872 00602SVM 00000 00000 01759 01020 02010 09982 09399 10000 00000 10000 04671 09998XGB 00000 00000 00099 00044 00122 07548 03776 09470 00000 10000 09681 08791 09997

and 10 we can see that the WR of MLP DBN and SAE haveno significant difference but they are significantly higherthan that of BAH and benchmark index and significantlylower than that of other trading algorithms TheWR of RNNLSTM and GRU have no significant difference but they aresignificantly higher than that of CART and significantly lowerthan that of NB and RF The WR of LR is not significantlydifferent from that of RF SVM and XGB

(7) Through the analysis of the hypothesis test of H7aand H7b we obtain p valuelt22e-16 Therefore there aresignificant differences between the ARR of all trading strate-gies including the benchmark index and BAH We needto do further multiple comparative analysis as shown inTable 11 From Tables 4 and 11 we can see that the ARR ofthe benchmark index and BAH are significantly lower thanthat of all ML algorithms The ARR of MLP DBN and SAEare significantly greater than that of RNN LSTM GRU NBand LR but not significantly different from that of CARTRF SVM and XGB there is no significant difference betweenthe ARR of MLP DBN and SAE The ARR of RNN LSTM

and GRU are significantly less than that of CART but theyare not significantly different from that of other traditionalML algorithms In all traditional ML algorithms the ARR ofCART is significantly greater than that of NB and LR butotherwise there is no significant difference between ARR ofany other two algorithms

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore there are significantdifferences between ASR of all trading strategies includingthe benchmark index and BAH The results of our multiplecomparative analysis are shown in Table 12 From Tables 4and 12 we can see that the ASR of the benchmark index andBAH are significantly smaller than that of all ML algorithmsThe ASR of MLP and DBN are significantly greater than thatof CART and are significantly smaller than that of NB RFand XGB but there is no significant difference between MLPDBN and other algorithms The ASR of SAE is significantlygreater than that of CART and significantly less than that ofRF and XGB but there is no significant difference betweenSAE and other algorithms The ASR of RNN and LSTM

12 Mathematical Problems in Engineering

Table 13 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00052DBN 00000 00031 10000SAE 00000 00012 10000 10000RNN 00000 00000 01645 02243 03556LSTM 00000 00000 06236 07173 08511 10000GRU 00000 00000 00245 00381 00760 10000 09860CART 00000 00000 01496 02057 03309 10000 10000 10000NB 00000 00000 00786 01136 01999 10000 09994 10000 10000RF 00000 00000 00002 00004 00012 08964 04248 09980 09109 09713LR 00000 00000 05451 06428 07935 10000 10000 09933 10000 09998 05015SVM 00000 00000 02433 03194 04734 10000 10000 09999 10000 10000 08155 10000XGB 00000 00000 00103 00167 00360 09998 09462 10000 09999 10000 09998 09685 09989

Table 14 Trading performance of different trading strategies in CSICS Best performance of all trading strategies is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGBAR mdash mdash 05175 05167 05163 05030 04993 04993 05052 05084 05090 05084 05112 05087PR mdash mdash 07548 07436 07439 05414 04964 04956 05022 05109 05128 04967 05695 05026RR mdash mdash 05252 05250 05248 05234 05224 05223 05279 05307 05311 05318 05295 05315F1 mdash mdash 06150 06108 06108 05320 05086 05082 05143 05192 05214 05132 05483 05164AUC mdash mdash 05027 05024 05020 05006 04995 04996 05049 05078 05082 05086 05074 05085WR 05222 05090 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803ARR 00633 02224 05731 05704 05678 05248 05165 05113 05534 06125 04842 05095 05004 04938ASR 02625 04612 14031 14006 13935 14880 15422 15505 12232 11122 14379 15582 14231 14698MDD 04808 06697 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632

are significantly greater than that of CART and significantlyless than that of RF but there is no significant differencebetweenRNN LSTM and other algorithmsTheASRofGRUis significantly greater than that of CART but there is nosignificant difference between GRU and other traditional MLalgorithms In all traditional ML algorithms the ASR of allalgorithms are significantly greater than that of CART butotherwise there is no significant difference between ASR ofany other two algorithms

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between MDD of trading strategies includingthe benchmark index and the BAH The results of multiplecomparative analysis are shown in Table 13 From Tables4 and 13 we can see that MDD of any ML algorithm issignificantly greater than that of the benchmark index butsignificantly smaller than that of BAH strategy The MDDof MLP and DBN are significantly smaller than those ofGRU RF and XGB but there is no significant differencebetween MLP DBN and other algorithms The MDD ofSAE is significantly smaller than that of XGB but there isno significant difference between SAE and other algorithmsOtherwise there is no significant difference betweenMDDofany other two algorithms

In a word the traditional ML algorithms such as NBRF and XGB have good performance in most directional

evaluation indicators such as AR PR and F1 The DNNalgorithms such as MLP have good performance in PR andARR In traditional ML algorithms the ARR of CART RFSVM and XGB are not significantly different from that ofMLP DBN and SAE the ARR of CART is significantlygreater than that of LSTM GRU and RNN but otherwisethe ARR of all traditional ML algorithms are not significantlyworse than that of LSTM GRU and RNN The ASR of alltraditional ML algorithms except CART are not significantlyworse than that of the six DNNmodels even the ASR of NBRF and XGB are significantly greater than that of some DNNalgorithms The MDD of RF and XGB are significantly lessthat of MLP DBN and SAE the MDD of all traditional MLalgorithms are not significantly different from that of LSTMGRU and RNNThe ARR and ASR of all ML algorithms aresignificantly greater than that of BAH and the benchmarkindex the MDD of any ML algorithm is significantly greaterthan that of the benchmark index but significantly less thanthat of BAH strategy

53 Comparative Analysis of Performance of Different TradingStrategies in CSICS The analysis methods of this part aresimilar to Section 52 From Table 14 we can see that the ARPR and F1 of MLP are the greatest in all trading algorithmsThe RR AUC WR and ASR of LR are the greatest inall trading algorithms respectively The ARR of NB is the

Mathematical Problems in Engineering 13

Table 15Multiple comparison analysis between theARof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 01857GRU 00000 00000 00000 04439 10000CART 00000 00000 00000 09765 00024 00131NB 00000 00001 00002 00022 00000 00000 01810RF 00000 00002 00005 00007 00000 00000 00941 10000LR 00000 00000 00000 00076 00000 00000 03454 10000 10000SVM 00217 00766 01309 00000 00000 00000 00003 08314 09352 06360XGB 00000 00001 00001 00025 00000 00000 01930 10000 10000 10000 08168

Table 16Multiple comparison analysis between the PRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 09906 09781NB 00000 00000 00000 00000 01716 01234 08940RF 00000 00000 00000 00000 00319 00205 05271 10000LR 00000 00000 00000 00000 10000 10000 09951 02099 00422SVM 00000 00000 00000 01157 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00000 09922 09811 10000 08836 05086 09960 00000

highest in all trading strategies The MDD of CSI 300 index(benchmark index) is the smallest in all trading strategiesTheWRARR and ASR of all ML algorithms are greater thanthose of the benchmark index and BAH strategy

(1) Through the hypothesis test analysis of H1a and H1bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the AR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 15The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 15 we can see that the AR ofMLPDBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms except for SVM The ARof GRU is significantly smaller than that of all traditional MLalgorithms There is no significant difference between the ARof any two traditional ML algorithms except for CART andSVM

(2) Through the hypothesis test analysis of H2a and H2bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the PR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 16 The number in the tableis a p value of any two algorithms of Nemenyi test FromTables 14 and 16 we can see that the PR of MLP DBN and

SAE are significantly greater than that of all other tradingalgorithms and the PR of MLP DBN and SAE have nosignificant difference The PR of SVM is significantly greaterthan that of all other traditional ML algorithms which haveno significant difference between any two algorithms exceptfor SVM The PR of RNN is significantly greater than thatof all traditional ML algorithms except for SVM The PR ofGRU and LSTM are not significantly different from that of alltraditional ML algorithms except for SVM and LR

(3) Through the hypothesis test analysis of H3a and H3bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the RR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 17 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 17 we can see that the RR of all DNN models arenot significantly different There is no significant differenceamong the RR of all traditional ML algorithms The RR ofRNN GRU and LSTM are significantly smaller than that ofany traditional ML algorithm except for CART

(4) Through the hypothesis test analysis of H4a and H4bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the F1 of all trading algorithms There-fore we need to do further multiple comparative analysis and

14 Mathematical Problems in Engineering

Table 17Multiple comparison analysis between the RRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 09996 09996 10000LSTM 09309 09314 09781 09999GRU 09660 09663 09916 10000 10000CART 09744 09742 09225 05809 01509 02138NB 01093 01088 00574 00075 00004 00007 08861RF 00537 00534 00260 00028 00001 00002 07544 10000LR 00330 00328 00152 00015 00001 00001 06498 10000 10000SVM 03444 03434 02170 00434 00033 00059 09920 10000 09998 09991XGB 00193 00192 00085 00007 00000 00000 05344 10000 10000 10000 09960

Table 18 Multiple comparison analysis between the F1 of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 07211 06670NB 00000 00000 00000 00136 00132 00099 08664RF 00000 00000 00000 00786 00016 00011 05162 10000LR 00000 00000 00000 00000 09440 09208 10000 05675 02181SVM 00000 00000 00000 00178 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00001 03138 02679 10000 09937 08849 09964 00000

Table 19 Multiple comparison analysis between the AUC of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 09999 10000RNN 09945 09985 10000LSTM 05273 06382 09259 09937GRU 08448 09102 09958 10000 10000CART 06921 05835 02356 00801 00014 00096NB 00002 00001 00000 00000 00000 00000 02616RF 00001 00001 00000 00000 00000 00000 02002 10000LR 00000 00000 00000 00000 00000 00000 00930 10000 10000SVM 00027 00014 00001 00000 00000 00000 06454 10000 09999 09980XGB 00000 00000 00000 00000 00000 00000 01257 10000 10000 10000 09993

the results are shown in Table 18The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 18 we can see that the F1 of MLP DBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms There is no significantdifference among traditionalML algorithms except SVM andthe F1 of SVM is significantly greater than that of all othertraditional ML algorithms

(5) Through the hypothesis test analysis of H5a and H5bwe can obtain p valuelt22e-16Therefore there are significantdifferences between theAUCof all trading algorithmsThere-fore we need to do further multiple comparative analysis andthe results are shown in Table 19 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 19 we can see that the AUC of all DNN models haveno significant difference There is no significant difference

Mathematical Problems in Engineering 15

Table 20 Multiple comparison analysis between the WR of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 04117MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00002 00006 00000LSTM 00000 00000 00000 00000 00000 09772GRU 00000 00000 00000 00000 00000 09911 10000CART 09931 00000 00000 00000 00000 00000 00000 00000NB 00031 00000 00001 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00205 06437 05358 00000 00000LR 00000 00000 00000 00000 00000 00010 01611 01105 00000 00000 10000SVM 00000 00000 00000 00000 00000 09914 10000 10000 00000 00000 05322 01090XGB 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000

Table 21Multiple comparison analysis between theARRof any two trading strategiesThepvalue of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00007MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 04790 06355 07182LSTM 00000 00000 02512 03806 04630 10000GRU 00000 00000 02235 03454 04249 10000 10000CART 00000 00000 08301 09217 09542 10000 09999 09998NB 00000 00000 10000 10000 10000 02920 01295 01125 06517RF 00000 00000 00020 00048 00076 08705 09735 09806 05393 00006LR 00000 00000 02058 03222 03995 10000 10000 10000 09996 01019 09845SVM 00000 00000 10000 00803 01114 09993 10000 10000 09659 00165 09999 10000XGB 00000 00000 10000 00333 00484 09916 09997 09998 08789 00057 10000 09999 10000

between the AUC of all traditional ML algorithms TheAUC of all traditional ML algorithms except for CART aresignificantly greater than that of any DNN model There isno significant difference among the AUC ofMLP SAE DBNRNN and CART

(6)Through the hypothesis test analysis of H6a and H6bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the WR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 20 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 20 we can see that the WR of BAH and benchmarkindex have no significant difference but they are significantlysmaller than that of anyML algorithmTheWRofMLPDBNand SAE are significantly smaller than that of the other trad-ing algorithms but there is no significant difference betweenthe WR of MLP DBN and SAE The WR of LSTM andGRU have no significant difference but they are significantlysmaller than that of XGB and significantly greater than that of

CART and NB In traditional MLmodels the WR of NB andCART are significantly smaller than that of other algorithmsThe WR of XGB is significantly greater than that of all otherML algorithms

(7)Through the analysis of the hypothesis test of H7a andH7b we obtain p valuelt22e-16

Therefore there are significant differences between theARR of all trading strategies including the benchmark indexand BAH strategy Therefore we need to do further multiplecomparative analysis and the results are shown in Table 21FromTables 14 and 21 we can see that ARR of the benchmarkindex and BAH are significantly smaller than that of alltrading algorithms The ARR of MLP is significantly higherthan that of RF but there is no significant difference betweenMLP and other algorithms The ARR of SAE and DBN aresignificantly higher than that of RF and XGB but they arenot significantly different fromARR of other algorithms TheARR of NB is significantly higher than that of RF SVMand XGB But otherwise there is no significant difference

16 Mathematical Problems in Engineering

Table 22Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 08877MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 09099 08862 08114LSTM 00000 00000 03460 03080 02239 09999GRU 00000 00000 02132 01853 01270 09981 10000CART 00000 00000 00158 00195 00327 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000 00000 07298RF 00000 00000 10000 10000 10000 09968 07444 05789 00018 00000LR 00000 00000 01181 01003 00650 09879 10000 10000 00000 00000 04044SVM 00000 00000 10000 10000 10000 09849 05952 04238 00042 00000 10000 02704XGB 00000 00000 09937 09902 09746 10000 09878 09532 00001 00000 10000 08723 09998

Table 23 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00006DBN 00000 00004 10000SAE 00000 00023 10000 10000RNN 00000 00000 00320 00421 00111LSTM 00000 00000 00002 00003 00000 09947GRU 00000 00000 00001 00001 00000 09767 10000CART 00000 00000 01238 01538 00521 10000 09241 08305NB 00000 01875 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 01180 01469 00493 10000 09298 08401 10000 00000LR 00000 00000 00001 00002 00000 09881 10000 10000 08821 00000 08898SVM 00000 00000 03285 03839 01701 09999 07011 05424 10000 00000 10000 06216XGB 00000 00000 00308 00405 00106 10000 09951 09783 10000 00000 10000 09890 09998

between any other two algorithms Therefore the ARR ofmost traditional ML models are not significantly worse thanthat of the best DNNmodel

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore There are significantdifferences betweenASRof all trading strategies including thebenchmark index and BAH strategy The results of multiplecomparative analysis are shown in Table 22 From Tables 14and 22 we can see that the ASR of the benchmark indexand BAH are significantly smaller than that of all tradingalgorithms The ASR of all ML algorithms are significantlyhigher than that of CART and NB but there is no significantdifference between the ASR of CART and NB Beyond thatthere is no significant difference between any other twoalgorithms Therefore the ASR of all traditional ML modelsexcept NB and CART are not significantly worse than that ofany DNNmodel

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between the MDD of these trading strategies

including the benchmark index and the BAH strategyThe results of multiple comparative analysis are shown inTable 23 From Tables 14 and 23 we can see that the MDDof the benchmark index is significantly smaller than that ofother trading strategies including BAH strategy TheMDD ofBAH is significantly greater than that of all trading algorithmsexcept NBTheMDDofMLPDBN and SAE are significantlylower than that of NB but significantly higher than thatof RNN LSTM GRU LR and XGB The MDD of NB issignificantly greater than that of all other trading algorithmsBeyond that there is no significant difference between anyother two algorithms Therefore all ML algorithms expectNB especially LSTM RNN GRU LR and XGB can play arole in controlling trading risk

In a word some DNN models such as MLP DBN andSAE have good performance in AR PR and F1 traditionalML algorithms such as LR and XGB have good performanceinAUCandWRTheARRof some traditionalML algorithmssuch as CART NB LR and SVM are not significantlydifferent from that of the six DNN models The ASR of the

Mathematical Problems in Engineering 17

six DNN algorithms are not significantly different from alltraditional ML models except NB and CART The MDD ofLR and XGB are significantly smaller than those of MLPDBN and SAE and are not significantly different fromthat of LSTM GRU and RNN The ARR and ASR of allML algorithms are significantly greater than those of BAHand benchmark index the MDD of all ML algorithms aresignificantly smaller than that of the benchmark index butsignificantly greater than that of BAH strategy

From the above analysis and evaluation we can see thatthe directional evaluation indicators of some DNN modelsare very competitive in CSICS while the indicators of sometraditional ML algorithms have excellent performance inSPICS Whether in SPICS or CSICS the ARR and ASR ofall ML algorithms are significantly greater than that of thebenchmark index and BAH strategy respectively In all MLalgorithms there are always some traditional ML algorithmswhich are not significantly worse than the best DNN modelfor any performance evaluation indicator (ARR ASR andMDD)Therefore if we do not consider transaction cost andother factors affecting trading performance of DNN modelsare alternative but not the best choice when they are appliedto stock trading

In the same period the ARR of any ML algorithm inCSICS is significantly greater than that of the same algorithmin SPICS (p valuelt0001 in theNemenyi test)Meanwhile theMDD of any ML algorithm in CSICS is significantly greaterthan that of the same algorithm in SPICS (p value lt0001in the Nemenyi test) The results show that the quantitativetrading algorithms can more easily obtain excess returns inthe Chinese A-share market but the volatility risk of tradingin Chinese A-share market is significantly higher than that ofthe US stock market in the past 8 years

6 The Impact of Transaction Cost onPerformance of ML Algorithms

Trading cost can affect the profitability of a stock tradingstrategy Transaction cost that can be ignored in long-termstrategies is significantly magnified in daily trading Howevermany algorithmic trading studies assume that transactioncost does not exist ([10 17] etc) In practice frictions suchas transaction cost can distort the market from the perfectmodel in textbooks The cost known prior to trading activityis referred to as transparent such as commissions exchangefees and taxes The costs that has to be estimated are knownas implicit including comprise bid-ask spread latency orslippage and related market impact This section focuses onthe transparent and implicit cost and how do they affecttrading performance in daily trading

61 Experimental Settings and Backtesting Algorithm In thispart the transparent transaction cost is calculated by a certainpercentage of transaction turnover for convenience theimplicit transaction cost is very complicated in calculationand it is necessary to make a reasonable estimate for therandom changes of market environment and stock pricesTherefore we only discuss the impact of slippage on tradingperformance

The transaction cost structures of American stocks aresimilar to that of Chinese A-shares We assume that transpar-ent transaction cost is calculated by a percentage of turnoversuch as less than 05 [40 41] and 02 and 05 in theliterature [42] It is different for the estimation of slippage

In some quantitative trading simulation software such asJoinQuant [43] and Abuquant [44] the slippage is set to 002The transparent transaction cost and implicit transaction costare charged in both directions when buying and selling Itis worth noting that the transparent transaction cost varieswith the different brokers while the implicit transaction costis related to market liquidity market information networkstatus trading software etc

We set slippages s = s0=0 s1=001 s2=002 s3=003s4=004 the transparent transaction cost c = c0=0 c1=0001c2=0002 c3=0003 c4=0004 c5=0005 For different s ccombinations we study the impact of different transactioncost structures on trading performance We assume thatbuying and selling positions are one unit so the turnover isthe corresponding stock price When buying stocks we notonly need to pay a certain percentage cost of the purchaseprice but also need to pay an uncertain slippage cost Thatis we need to pay a higher price than the real-time price119875119905minus1

when we are buying But when selling stocks we notonly need to pay a certain percentage cost of the sellingprice but also to pay an uncertain slippage cost Generallyspeaking we need to sell at a price lower than the real-timeprice 119875

119905 It is worth noting that our trading strategy is self-

financing If ML algorithms predict the continuous occur-rence of buying signals or selling signals ie |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 0 we will continue to hold or do nothingso the transaction cost at this time is 0 when |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 1 it is indicated that the position maybe changed from holding to selling or from empty positionto buying At this time we would pay transaction costdue to the trading operation Finally we get a real yieldis

119877119890119905119905le119862119897119900119904119890119875119903119894119888119890

119905minus 119862119897119900119904119890119875119903119894119888119890

119905minus1

119862119897119900119904119890119875119903119894119888119890119905minus1

119875119905= 119862119897119900119904119890119875119903119894119888119890

119905

lowast (1 minus 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816)

minus 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816

119875119905minus1

= 119862119897119900119904119890119875119903119894119888119890119905minus1

lowast (1 + 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816)

+ 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816

119877119890119905119905=119875119905minus 119875119905minus1

119875119905minus1

(5)

where 119862119897119900119904119890119875119903119894119888119890119905

denotes the 119905-th closing price119879119903119886119889119890119878119894119892119899119886119897

119905denotes the 119905-th trading signal 119875

119905denotes

the 119905-th executing price and 119877119890119905119905denotes the 119905-th return rate

We propose a backtesting algorithm with transaction costbased on the above analysis as is shown in Algorithm 3

18 Mathematical Problems in Engineering

Input TS TS is trading signals of a stocks s is slippagec c is transparent transaction cost

Output WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) WR=NULL ARR=NULL ASR=NULL MDD=NULL(3) for (i in 1 N) (4) Stock Data=Stock Code List[i](5) ClosePricet=Stock Data [ldquoClosing Pricerdquo](6) Pt =ClosePricet lowast(1-clowastabs(TSt-TSt-1)) - slowastabs(TSt-TSt-1)(7) Pt-1 =ClosePricetlowast(1+clowastabs(TSt-TSt-1)) + slowastabs(TSt-TSt-1)(8) Rett= (Pt- Pt-1) Pt Ret is the return rate series(9) TDRR=lag (TS)lowastRet TDRR is the daily return through trading(10) WR[i]=sum (TDRRgt0)sum(TDRR =0)(11) ARR[i]=Returnannualized (TDRR)(12) ASR[i]=SharpeRatioannualized (TDRR)(13) MDD[i]=maxDrawDown (TDRR)(14) WR=c (WR WR[i])(15) ARR=c (ARR ARR[i])(16) ASR=c (ASR ASR[i])(17) MDD=c (MDD MDD[i])(18) (19) return (WR ARR ASR MDD)

Algorithm 3 Backtesting algorithm with transaction cost in R language

62 Analysis of Impact of Transaction Cost on the TradingPerformance of SPICS Transaction cost is one of the mostimportant factors affecting trading performance In US stocktrading transparent transaction cost can be charged accord-ing to a fixed fee per order or month or a floating fee basedon the volume and turnover of each transaction Sometimescustomers can also negotiate with broker to determinetransaction cost The transaction cost charged by differentbrokers varies greatly Meanwhile implicit transaction costis not known beforehand and the estimations of them arevery complex Therefore we assume that the percentageof turnover is the transparent transaction cost for ease ofcalculation In the aspect of implicit transaction cost we onlyconsider the impact of slippage on trading performance

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 24 WR is decreasing with the increase oftransaction cost for any trading algorithm which is intuitiveWhen the transaction cost is set to (s c) = (004 0005) theWR of each algorithm is the lowest Compared with setting(s c) = (0 0) the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR and SVM to XGB are reduced by580 597 591 1583 1804 1395 2171 16042216 1854 1850 and 2597 respectively ThereforeMLP DBN and SAE are more tolerant to transaction costGenerally speaking the DNN models have stronger capacityto accommodate transaction cost than the traditional MLmodels From the single trading algorithm such as MLP ifwe do not consider slippage ie s=0 the average WR ofMLP is 05510 under transaction cost structures (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not considertransparent transaction cost ie c=0 the averageWRofMLP

is 05618 under transaction cost structures (s1 c0) (s2 c0)(s3 c0) (s4 c0) so transparent transaction cost has greaterimpact than slippageThroughmultiple comparative analysisthe WR under the transaction cost structure (s1 c0) is notsignificantly different from the WR without transaction costfor MLP DBN and SAETheWR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the WR under the transaction cost structure (s1 c0) (s2 c0) are not significantly different from theWRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 25 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the lowest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 4031 4157 and 4093 respectivelywhile the ARR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin accounts For a general setting of s and c ie (s c) = (0020003) ARR of MLP DBN and SAE decrease by 23262400 and 2361 respectively while the ARR of otheralgorithms decrease by more than 50 and that of CARTand XGB decrease bymore than 100ThereforeMLP DBNand SAE are more tolerant to high transaction cost Fromsingle trading algorithm such as RNN if we do not considerslippage ie s=0 the average ARR of RNN is 01434 under

Mathematical Problems in Engineering 19

Table24Th

eWRof

SPICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

05676

05680

05683

05843

05825

05844

05266

05930

05912

05859

05831

05891

(s0c1)

05615

05618

05621

05669

05626

05694

05052

05752

05663

05654

05630

05599

(s0c2)

05560

05560

05564

05507

05442

05553

04847

05585

05429

05463

05438

05324

(s0c3)

05507

05506

05510

05353

05269

05418

04652

05424

05205

05278

05253

05061

(s0c4)

05457

05454

05460

05206

05101

05289

044

7005277

04996

05105

05084

04818

(s0c5)

05410

05407

05412

05071

04946

05170

04303

05138

04803

04947

04924

04594

(s1c0)

056

49056

53056

5605778

05751

05785

05190

058

61058

2405782

05759

05788

(s1c1)

05594

05597

05600

05619

05571

05648

04991

05700

05597

05595

05574

05521

(s1c2)

05539

05539

05544

05458

05389

05508

04788

05534

05364

05406

05383

05249

(s1c3)

05487

05486

05491

05305

05215

05375

04597

05375

05141

05223

05200

04988

(s1c4)

05438

05436

05441

05163

05052

05249

044

1805231

04938

05054

05034

04750

(s1c5)

05394

05390

05396

05032

04902

05132

04255

05097

04751

04900

04880

04532

(s2c0)

05628

05631

05635

05729

056

9705741

05134

058

1105758

05726

05704

05713

(s2c1)

05573

05574

05578

05568

05515

05602

04931

05647

05527

05535

05515

05442

(s2c2)

05518

05518

05523

05408

05336

05463

04729

05482

05297

05349

05326

05172

(s2c3)

05469

05467

05472

05260

05164

05334

04543

05330

05082

05171

05150

04918

(s2c4)

05421

05417

05423

05120

05004

05209

04368

05187

04881

05004

04986

046

85(s2c5)

05377

05373

05379

04993

04858

05096

04209

05055

04699

04855

04835

044

73(s3c0)

05606

05609

05612

05678

05640

05694

05074

05759

05690

05668

05646

05635

(s3c1)

05552

05553

05558

05518

05460

05556

04872

05595

05460

05478

05459

05365

(s3c2)

05499

05498

05503

05362

05284

05422

046

7505434

05233

05295

05273

05099

(s3c3)

05450

05448

05453

05216

05114

05292

04491

05284

05020

05120

05098

04849

(s3c4)

05405

05401

05407

05080

04960

05172

04321

05146

04827

04959

04940

04622

(s3c5)

05362

05357

05363

04955

04816

05063

04166

05017

04651

04815

04793

044

17(s4c0)

05587

05589

05593

05630

05588

05652

05019

05710

05627

05613

05593

05562

(s4c1)

05533

05533

05537

05470

05407

05513

04815

05544

05395

05424

05404

05290

(s4c2)

05480

05479

05484

05316

05232

05380

04620

05386

05171

05242

05220

05026

(s4c3)

05432

05429

05435

05172

05067

05253

044

4005241

04964

05070

05051

04782

(s4c4)

05388

05384

05391

05041

04917

05137

04274

05106

04775

04914

04897

04564

(s4c5)

05347

05341

05347

04918

04774

05029

04123

04979

046

0204773

04752

04361

20 Mathematical Problems in Engineering

Table25Th

eARR

ofSP

ICSford

ailytradingwith

different

transactioncost

Ther

esultthatthere

isno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

03332

03296

03325

02943

02920

02934

03317

02975

03133

02942

03067

03041

(s0c1)

03128

030

8703118

02439

02327

02521

02266

02496

02384

02336

02400

02137

(s0c2)

02924

02879

02912

01936

01735

02108

01216

02017

01636

01731

01734

01234

(s0c3)

02721

02672

02706

01433

0114

301697

00168

01539

00889

01126

01070

00333

(s0c4)

02519

02464

02500

00931

00553

01285

-00878

01062

00143

00522

004

06-00567

(s0c5)

02316

02257

02294

00430

-00037

00875

-019

2400586

-00602

-0008

-00257

-014

66(s1c0)

03249

03212

03242

027

7802729

02794

029

53028

18028

9802747

028

5502762

(s1c1)

03046

03004

03035

02274

02136

02381

01902

02339

02149

02141

02188

01859

(s1c2)

02842

02796

02829

01771

01544

01969

00853

01861

01401

01536

01523

00957

(s1c3)

02639

02588

02623

01269

00953

01557

-00195

01383

00654

00931

00858

000

56(s1c4)

02437

02381

02417

00767

00363

0114

6-012

41009

06-00091

00328

00195

-00844

(s1c5)

02234

02174

02211

00266

-00226

00735

-02285

00430

-00836

-00275

-0046

8-01742

(s2c0)

03167

03129

03159

026

1302538

026

54025

89026

61026

6302551

026

43024

84(s2c1)

02964

02921

02952

02110

01946

02241

01539

02182

01914

01946

01977

01581

(s2c2)

0276

02713

02746

01607

01354

01829

00490

01704

0116

701341

01312

006

79(s2c3)

02557

02505

02540

0110

400763

01418

-00557

01227

004

2000737

006

47-00221

(s2c4)

02355

02298

02334

006

0300173

01007

-016

0300750

-00325

00134

-00016

-01120

(s2c5)

02153

02091

02129

00102

-00416

00597

-0264

700274

-010

69-00469

-00678

-02018

(s3c0)

030

85030

46030

7602448

02348

02514

02225

02504

02428

02356

02431

02206

(s3c1)

02881

02838

02869

01945

01756

02102

0117

502026

01680

01751

01765

01304

(s3c2)

02678

02630

02663

01442

01164

01690

00127

01548

00933

0114

601100

004

02(s3c3)

02476

02422

02457

00940

00574

01279

-00919

01071

00187

00543

00436

-00498

(s3c4)

02273

02215

02252

00439

-00016

00868

-019

6400595

-00558

-0006

-00227

-013

97(s3c5)

02071

02008

02047

-00062

-0060

5004

58-0300

800119

-013

02-00662

-00889

-02294

(s4c0)

03003

02962

02993

02284

02157

02374

01862

02348

02193

02161

02219

01929

(s4c1)

02799

02754

02786

01781

01565

01962

00813

01870

01445

01556

01554

01026

(s4c2)

02597

02547

02580

01278

00974

01551

-00235

01392

00699

00952

00889

00125

(s4c3)

02394

02339

02375

00776

00384

0114

0-012

8100915

-0004

700349

00226

-00774

(s4c4)

02192

02132

02169

00275

-00205

00729

-02326

00439

-00792

-00254

-00437

-016

73(s4c5)

01989

01926

01964

-00225

-00794

00319

-033

69-00037

-015

35-00856

-010

99-02570

Mathematical Problems in Engineering 21

the transaction cost structures (s0 c1) (s0 c2) (s0 c3) (s0c4) (s0 c5) if we do not consider transparent transactioncost ie c=0 the average ARR of RNN is 02531 under thetransaction cost structure (s1 c0) (s2 c0) (s3 c0) (s4c0) so transparent transaction cost has greater impact thanslippage Through multiple comparative analysis the ARRunder the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s0 c1) are not significantly different from the ARRwithout transaction cost for MLP DBN and SAE the ARRunder all other transaction cost structures are significantlysmaller than theARRwithout transaction cost For all tradingalgorithms except for MLP DBN and SAE the ARR underthe transaction cost structures (s1 c0) (s2 c0) are notsignificantly different from the ARR without transactioncost the ARR under all other transaction cost structures aresignificantly smaller than the ARR without transaction cost

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 26 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theASR of each algorithm is the lowest Compared with settingwithout transaction cost the ASR of MLP DBN and SAEreduce by 3997 4123 and 4066 respectively while theASR of other trading algorithms reduce by more than 90compared with the case of no transaction cost Thereforeexcessive transaction cost will significantly reduce ASR Fora general setting of s and c ie (s c) = (002 0003) theASR of MLP DBN and SAE decrease by 2262 2336and 2302 respectively while the ASR of other algorithmsdecrease by more than 50 the ASR of CART and XGBdecrease by more than 100Therefore MLP DBN and SAEare more tolerant to transaction cost From single tradingalgorithm such as NB if we do not consider slippage ies=0 the average ASR of NB is 08052 under the transactioncost structure (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5)if we do not consider transparent transaction cost ie c=0the average ASR of NB is 14182 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has greater impact than slippage Throughmultiple comparative analysis the ASR under the transactioncost structures (s1 c0) (s2 c0) (s3 c0) (s0 c1) are notsignificantly different from the ASR without transaction costfor MLP DBN and SAE the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the ASR under the transaction cost structures(s1 c0) (s2 c0) are not significantly different from the ASRwithout transaction cost the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 27 MDD increases with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the settings without transaction cost theMDD of MLP DBN and SAE increase by 932 1108 and

1032 respectively The MDD of other trading algorithmsincrease by more than 80 compared with those withoutconsidering transaction costTherefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 483 580 and 533respectively while the MDD of other algorithms increase bymore than 35 and theMDDofCART RF andXGB increasebymore than 100Therefore MLP DBN and SAE are moretolerant to transaction cost As awhole theDNNmodels havestronger capacity to accommodate transaction cost than thetraditional ML models From single trading algorithm suchas GRU if we do not consider slippage ie s=0 the averageMDD of GRU is 04459 under the transaction cost structures(s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do notconsider transparent transaction cost ie c=0 the averageMDD of GRU is 03559 under the transaction cost structures(s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparent transactioncost has greater impact than slippage Through multiplecomparative analysis the MDD under any the transactioncost structure is not significantly different from the MDDwithout transaction cost for MLP DBN and SAE For alltrading algorithms except for MLP DBN and SAE such asLR the MDD under the transaction cost structures (s0 c1)(s1 c0) (s2 c0) (s3 c0) are not significantly different fromthe MDD without transaction cost the MDD under all othertransaction cost structures are significantly greater than theMDD without transaction cost

Through the analysis of the Table 27 performance eval-uation indicators we find that trading performance afterconsidering transaction cost will be worse than that withoutconsidering transaction cost as is in actual trading situationIt is noteworthy that the performance changes of DNNalgorithms especially MLP DBN and SAE are very smallafter considering transaction cost This shows that the threealgorithms have good tolerance to changes of transactioncost Especially for the MDD of the three algorithms thereis no significant difference with that with no transactioncost So we can consider applying them in actual tradingMeanwhile we conclude that the transparent transactioncost has greater impact on the trading performances thanthe slippage for SPICS This is because the prices of SPICSare too high when the transparent transaction cost is setto a certain percentage of turnover In actual transactionsspecial attention needs to be paid to the fact that the trans-action performance under most transaction cost structuresis significantly lower than the trading performance withoutconsidering transaction cost It is worth noting that theperformance of traditional ML algorithm is not worse thanthat ofDNNalgorithmswithout considering transaction costwhile the performance of DNN algorithms is better than thatof traditional ML algorithms after considering transactioncost

63 Analysis of Impact of Transaction Cost on the TradingPerformance of CSICS Similar to Section 62 we will discussthe impact of transaction cost on trading performance ofCSICS in the followings In the Chinese A-share marketthe transparent transaction cost is usually set to a certain

22 Mathematical Problems in Engineering

Table26Th

eASR

ofSP

ICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

1546

815

412

15502

15764

15571

15828

13927

16237

16763

15818

16018

16298

(s0c1)

1456

214

478

14577

1300

012

317

13565

09346

13554

12650

12472

12456

11294

(s0c2)

13639

13527

13635

10191

09015

11262

04657

10822

08482

09074

08846

06236

(s0c3)

12702

12561

12679

07355

05690

08929

-00085

08061

04298

05652

05216

0118

2(s0c4)

11751

11581

11709

04511

02366

06580

-04823

05291

00139

02234

01596

-03812

(s0c5)

1079

10591

10728

01678

-00931

04227

-09500

02534

-039

59-01152

-019

87-08696

(s1c0)

15121

1505

715

149

1492

714

606

15119

1244

915

424

1558

214

825

14974

1488

6(s1c1)

14208

14116

14217

12146

11334

12841

07823

12722

1144

711459

11394

09859

(s1c2)

13279

13159

13270

09325

08020

10526

03105

09977

07267

08048

07772

04792

(s1c3)

12337

12188

12308

064

8204690

08185

-016

4607209

03082

04622

04139

-00257

(s1c4)

11382

11204

11333

03637

01368

05831

-06374

04438

-010

6801208

00524

-052

31(s1c5)

10417

10210

10348

00807

-019

2003478

-110

2501686

-05146

-02169

-0304

7-10083

(s2c0)

1477

1469

914

792

1408

113

632

1440

310

946

1460

114

390

1382

213

922

1346

2(s2c1)

13851

13752

13854

11285

10343

12111

06283

11883

10237

10439

10325

08416

(s2c2)

12916

12789

12901

08454

07021

09785

01547

09128

060

4907019

06696

03346

(s2c3)

11969

11812

11934

05607

03688

07437

-032

0506355

01868

03591

03063

-016

90(s2c4)

11010

10825

10955

02763

00372

05081

-07916

03586

-02268

00183

-00545

-06639

(s2c5)

1004

109827

09967

-0006

-02905

02729

-12533

00841

-06323

-031

79-04101

-114

54(s3c0)

14415

14337

14432

13227

12650

13679

09425

13770

13189

12810

12862

12030

(s3c1)

13490

13384

13488

10419

09348

11375

04733

11039

09023

09413

09252

06971

(s3c2)

12551

12416

12529

07580

060

19090

40-00013

08275

04832

05988

05618

01904

(s3c3)

11599

11435

11558

04731

02688

066

88-04757

05500

00658

02562

01988

-031

16(s3c4)

10636

10443

10575

01891

-00620

04331

-0944

202735

-0346

0-00836

-016

08-08034

(s3c5)

09664

09443

09584

-00924

-03883

01982

-14018

000

00-074

89-04183

-05146

-12808

(s4c0)

14058

13972

1406

812

368

11662

12950

07892

12933

11983

11793

11796

10591

(s4c1)

13127

13013

13119

09549

08350

10634

03180

10190

07807

08386

08177

05527

(s4c2)

12183

1204

12155

06705

05018

08293

-015

6807421

03617

04958

04542

004

68(s4c3)

11226

11055

11179

03857

01691

05938

-06295

046

47-00545

01537

00918

-04529

(s4c4)

1026

1006

10193

01021

-016

0703582

-10948

01888

-0464

2-018

49-02665

-09413

(s4c5)

09286

09057

09199

-017

83-04853

01238

-15478

-00836

-0864

2-05177

-06182

-14142

Mathematical Problems in Engineering 23

Table 27 The MDD of SPICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 03583 03584 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338(s0 c1) 03629 03638 03594 03779 03986 03636 04072 03712 03843 03963 03972 04203(s0 c2) 03677 03695 03647 04302 04707 03968 05168 04127 04842 04729 04787 05735(s0 c3) 03727 03756 03703 04990 05639 04376 06564 04709 06172 05682 05844 07335(s0 c4) 03781 03821 03764 05767 06612 04873 07804 05424 07377 06653 06913 08447(s0 c5) 03839 03890 03828 06529 0746 05444 08730 06162 08272 07501 07808 09118(s1 c0) 03596 03600 03560 03500 036130 03446 03574 03502 03414 03585 03569 03540(s1 c1) 03642 03655 03609 03907 04156 03717 04320 03814 04067 04154 04170 04541(s1 c2) 03691 03712 03662 04466 04936 04066 05534 04270 05172 04971 05049 06168(s1 c3) 03742 03774 03720 05183 05895 04495 06928 04885 06499 05937 06129 07662(s1 c4) 03796 03839 03781 05961 06842 05013 08105 05610 07631 06884 07161 08649(s1 c5) 03856 03909 03847 0671 07646 05595 08946 06342 08451 07691 0800 09235(s2 c0) 03609 03615 03573 03607 03756 03517 03770 03586 03586 03739 03727 03787(s2 c1) 03656 03671 03623 04047 04349 03805 04627 03929 04339 04365 04397 04929(s2 c2) 03705 03729 03678 04642 05176 04171 05916 04424 05504 05218 05327 06577(s2 c3) 03756 03792 03736 05377 06143 04624 07277 05067 06805 06183 06402 07939(s2 c4) 03812 03859 03799 06155 07056 05161 08380 05796 07856 07099 07388 08816(s2 c5) 03873 03930 03866 06887 07816 05751 09126 06517 08606 07864 08172 09331(s3 c0) 03622 03631 03588 03729 03912 03594 04004 03685 03795 03909 03909 04081(s3 c1) 03669 03687 03639 04200 04555 03901 04966 04062 04622 04587 04642 05334(s3 c2) 03719 03746 03694 04826 05423 04286 06295 04589 05833 05465 05607 06936(s3 c3) 03772 03811 03754 05572 06377 04762 07609 05248 07081 06420 06657 08175(s3 c4) 03829 03879 03818 06341 07254 05314 08620 05980 08054 07300 07593 08956(s3 c5) 03894 03954 03888 07056 07972 05909 09275 06689 08740 08022 08325 09412(s4 c0) 03635 03647 03602 03861 04082 03678 04274 03798 04015 04096 04114 04396(s4 c1) 03683 03704 03654 04362 04774 04005 05325 04211 04908 04814 04894 05730(s4 c2) 03734 03765 03712 05013 05664 04410 06667 04758 06142 05707 05875 07253(s4 c3) 03790 03833 03775 05765 06600 04905 07906 05429 07330 06644 06894 08375(s4 c4) 03851 03904 03841 06521 07439 05470 08824 06162 08230 07485 07782 09074(s4 c5) 03917 03981 03913 07218 08115 06067 09395 06857 08858 08165 08463 09480

percentage of turnover and it is the same as the assumptionin the experimental settings As in the US stock market thesmallest unit of price change is 001 (one tick) It is reasonableto set slippage to be 001-005 Of course it should be notedthat the prices fluctuation may be more intense when closingthan that in the middle of a trading day

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 28 the WR is decreasing with the increaseof transaction cost for any trading algorithm When thetransaction cost is set to (s c) = (004 0005) the WR of eachalgorithm is the smallest Comparedwith the settings withouttransaction cost the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR SVM and XGB are reduced by671 688 697 2269 1726 1548 2430 14912484 2112 2112 and 2919 respectively For a generalsetting of s and c ie (s c) = (002 0003) the WR ofMLP DBN and SAE decrease by 410 420 and 430respectively while the WR of other algorithms decrease bymore than 9 the WR of CART RF and XGB decrease by

more than 15 Therefore MLP DBN and SAE are moretolerant to transaction cost From single trading algorithmsuch as LSTM if we do not consider slippage ie s=0 theaverage WR of DBN is 05417 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage WR of LSTM is 05304 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the WR under the transactioncost structures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the WR without transaction cost for MLPDBN SAE and NB the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN SAE and NB the WR under the transaction coststructure (s0 c1) is not significantly different from the WRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

24 Mathematical Problems in Engineering

Table 28 The WR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803(s0 c1) 05523 05527 05525 05525 05608 05620 05009 05227 05612 05665 05571 05595(s0 c2) 05488 05492 05489 05389 05512 05535 04879 05149 05460 05542 05445 05411(s0 c3) 05453 05456 05452 05258 05414 05451 04747 05068 05313 05418 05320 05234(s0 c4) 05417 05419 05414 05127 05320 05368 04622 04991 05172 05297 05202 05067(s0 c5) 05383 05383 05379 05004 05230 05286 04504 04917 05036 05180 05088 04905(s1 c0) 05494 05499 05497 05444 05541 05558 04925 05170 05520 05584 05492 05488(s1 c1) 05456 05459 05456 05286 05424 05456 04775 05080 05342 05437 05345 05275(s1 c2) 05421 05423 05420 05161 05335 05377 04654 05007 05207 05320 05231 05110(s1 c3) 05386 05388 05383 05036 05246 05296 04530 04931 05065 05205 05116 04946(s1 c4) 05353 05354 05349 04915 05156 05218 04419 04861 04937 05095 05007 04795(s1 c5) 05323 05323 05317 04808 05076 05148 04315 04796 04817 04995 04905 04652(s2 c0) 05431 05434 05431 05219 05368 05403 04707 05036 05269 05374 05286 05189(s2 c1) 05395 05397 05393 05078 05266 05314 04573 04956 05115 05242 05154 05005(s2 c2) 05360 05361 05357 04960 05181 05237 04458 04886 04985 05134 05046 04853(s2 c3) 05331 05331 05326 04850 05100 05167 04352 04818 04864 05031 04945 04711(s2 c4) 05300 05300 05293 04743 05018 05093 04252 04752 04746 04931 04846 04572(s2 c5) 05273 05271 05266 04648 04946 05029 04159 04692 04639 04838 04755 04445(s3 c0) 05373 05374 05371 05019 05216 05265 04514 04917 05049 05186 05098 04932(s3 c1) 05341 05341 05336 04902 05128 05188 04399 04846 04917 05074 04990 04775(s3 c2) 05312 05312 05306 04798 05052 05122 04303 04782 04804 04977 04896 04644(s3 c3) 05281 05281 05275 04696 04976 05049 04206 04718 04689 04879 04799 04509(s3 c4) 05252 05251 05245 04598 04901 04984 04110 04657 04581 04785 04707 04378(s3 c5) 05226 05223 05218 04510 04833 04924 04023 04602 04481 04701 04621 04264(s4 c0) 05325 05325 05321 04860 05089 05150 04360 04816 04870 05030 04949 04723(s4 c1) 05294 05294 05289 04753 05010 05079 04258 04750 04752 04928 04849 04588(s4 c2) 05266 05265 05259 04653 04937 05013 04164 04690 04642 04838 04761 04458(s4 c3) 05238 05236 05230 04562 04864 04948 04073 04632 04541 04747 04672 04336(s4 c4) 05211 05208 05203 04475 04798 04891 03985 04577 04440 04662 04586 04218(s4 c5) 05186 05182 05176 04392 04733 04832 03901 04524 04348 04582 04509 04109

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 29 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the smallest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 5073 5175 and 5225 respectivelyWhile the ARR of other trading algorithms decrease bymore than 100 compared with those algorithms withouttransaction cost Therefore excessive transaction cost canlead to serious losses in the accounts For a general settingof s and c ie (s c) = (002 0003) ARR of MLP DBNand SAE decrease by 2741 2797 and 2825 respectivelywhile the ARR other algorithms decrease by more than 50and that of CART NB RF and XGB decrease by more than100 Therefore MLP DBN and SAE are more tolerant totransaction cost From single trading algorithm such as SAEif we do not consider slippage ie s=0 the average ARR ofSAE is 05040 under the transaction cost structure (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not consider

transparent transaction cost ie c=0 the averageARRof SAEis 04468 under the transaction cost structures (s1 c0) (s2c0) (s3 c0) (s4 c0) so transparent transaction cost hassmaller impact than slippage Through multiple comparativeanalysis the ARR under the transaction cost structures (s0c1) (s0 c2) (s0 c3) (s0 c1) (s1 c1) are not significantlydifferent from the ARR without transaction cost for MLPDBN and SAE the ARR under all other transaction coststructures are significantly smaller than the ARR withouttransaction cost For RNN LSTM GRU CART RF LR andSVM the ARR under the transaction cost structures (s0c1) (s0 c2) (s1 c0) are not significantly different fromthe ARR without transaction cost the ARR under all othertransaction cost structures are significantly smaller than theARR without transaction cost For NB and XGB the ARRunder the transaction cost structures (s0 c1) (s1 c0) arenot significantly different from the ARR without transactioncost the ARR under all other transaction cost structuresare significantly smaller than the ARR without transactioncost

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 11: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

Mathematical Problems in Engineering 11

Table 11Multiple comparison analysis between theARRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00001 00006 00001LSTM 00000 00000 00000 00002 00000 10000GRU 00000 00000 00001 00008 00001 10000 10000CART 00000 00000 10000 10000 10000 00001 00000 00001NB 00000 00000 00021 00094 00022 10000 09998 10000 00018RF 00000 00000 07978 09524 08036 01685 00874 01962 07745 05861LR 00000 00000 00002 00012 00002 10000 10000 10000 00002 10000 02408SVM 00000 00000 02375 04806 02427 07029 05214 07457 02178 09778 09999 08015XGB 00000 00000 00674 01856 00694 09423 08466 09576 00600 09996 09905 09739 10000

Table 12Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 09667MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 08763 07617 08998LSTM 00000 00000 09922 09701 09949 10000GRU 00000 00000 06124 04563 06537 10000 09996CART 00000 00000 00002 00005 00002 00000 00000 00000NB 00000 00000 00467 00233 00557 09529 07037 09971 00000RF 00000 00000 00000 00000 00000 00291 00042 01062 00000 08010LR 00000 00000 07506 06025 07859 10000 10000 10000 00000 09872 00602SVM 00000 00000 01759 01020 02010 09982 09399 10000 00000 10000 04671 09998XGB 00000 00000 00099 00044 00122 07548 03776 09470 00000 10000 09681 08791 09997

and 10 we can see that the WR of MLP DBN and SAE haveno significant difference but they are significantly higherthan that of BAH and benchmark index and significantlylower than that of other trading algorithms TheWR of RNNLSTM and GRU have no significant difference but they aresignificantly higher than that of CART and significantly lowerthan that of NB and RF The WR of LR is not significantlydifferent from that of RF SVM and XGB

(7) Through the analysis of the hypothesis test of H7aand H7b we obtain p valuelt22e-16 Therefore there aresignificant differences between the ARR of all trading strate-gies including the benchmark index and BAH We needto do further multiple comparative analysis as shown inTable 11 From Tables 4 and 11 we can see that the ARR ofthe benchmark index and BAH are significantly lower thanthat of all ML algorithms The ARR of MLP DBN and SAEare significantly greater than that of RNN LSTM GRU NBand LR but not significantly different from that of CARTRF SVM and XGB there is no significant difference betweenthe ARR of MLP DBN and SAE The ARR of RNN LSTM

and GRU are significantly less than that of CART but theyare not significantly different from that of other traditionalML algorithms In all traditional ML algorithms the ARR ofCART is significantly greater than that of NB and LR butotherwise there is no significant difference between ARR ofany other two algorithms

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore there are significantdifferences between ASR of all trading strategies includingthe benchmark index and BAH The results of our multiplecomparative analysis are shown in Table 12 From Tables 4and 12 we can see that the ASR of the benchmark index andBAH are significantly smaller than that of all ML algorithmsThe ASR of MLP and DBN are significantly greater than thatof CART and are significantly smaller than that of NB RFand XGB but there is no significant difference between MLPDBN and other algorithms The ASR of SAE is significantlygreater than that of CART and significantly less than that ofRF and XGB but there is no significant difference betweenSAE and other algorithms The ASR of RNN and LSTM

12 Mathematical Problems in Engineering

Table 13 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00052DBN 00000 00031 10000SAE 00000 00012 10000 10000RNN 00000 00000 01645 02243 03556LSTM 00000 00000 06236 07173 08511 10000GRU 00000 00000 00245 00381 00760 10000 09860CART 00000 00000 01496 02057 03309 10000 10000 10000NB 00000 00000 00786 01136 01999 10000 09994 10000 10000RF 00000 00000 00002 00004 00012 08964 04248 09980 09109 09713LR 00000 00000 05451 06428 07935 10000 10000 09933 10000 09998 05015SVM 00000 00000 02433 03194 04734 10000 10000 09999 10000 10000 08155 10000XGB 00000 00000 00103 00167 00360 09998 09462 10000 09999 10000 09998 09685 09989

Table 14 Trading performance of different trading strategies in CSICS Best performance of all trading strategies is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGBAR mdash mdash 05175 05167 05163 05030 04993 04993 05052 05084 05090 05084 05112 05087PR mdash mdash 07548 07436 07439 05414 04964 04956 05022 05109 05128 04967 05695 05026RR mdash mdash 05252 05250 05248 05234 05224 05223 05279 05307 05311 05318 05295 05315F1 mdash mdash 06150 06108 06108 05320 05086 05082 05143 05192 05214 05132 05483 05164AUC mdash mdash 05027 05024 05020 05006 04995 04996 05049 05078 05082 05086 05074 05085WR 05222 05090 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803ARR 00633 02224 05731 05704 05678 05248 05165 05113 05534 06125 04842 05095 05004 04938ASR 02625 04612 14031 14006 13935 14880 15422 15505 12232 11122 14379 15582 14231 14698MDD 04808 06697 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632

are significantly greater than that of CART and significantlyless than that of RF but there is no significant differencebetweenRNN LSTM and other algorithmsTheASRofGRUis significantly greater than that of CART but there is nosignificant difference between GRU and other traditional MLalgorithms In all traditional ML algorithms the ASR of allalgorithms are significantly greater than that of CART butotherwise there is no significant difference between ASR ofany other two algorithms

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between MDD of trading strategies includingthe benchmark index and the BAH The results of multiplecomparative analysis are shown in Table 13 From Tables4 and 13 we can see that MDD of any ML algorithm issignificantly greater than that of the benchmark index butsignificantly smaller than that of BAH strategy The MDDof MLP and DBN are significantly smaller than those ofGRU RF and XGB but there is no significant differencebetween MLP DBN and other algorithms The MDD ofSAE is significantly smaller than that of XGB but there isno significant difference between SAE and other algorithmsOtherwise there is no significant difference betweenMDDofany other two algorithms

In a word the traditional ML algorithms such as NBRF and XGB have good performance in most directional

evaluation indicators such as AR PR and F1 The DNNalgorithms such as MLP have good performance in PR andARR In traditional ML algorithms the ARR of CART RFSVM and XGB are not significantly different from that ofMLP DBN and SAE the ARR of CART is significantlygreater than that of LSTM GRU and RNN but otherwisethe ARR of all traditional ML algorithms are not significantlyworse than that of LSTM GRU and RNN The ASR of alltraditional ML algorithms except CART are not significantlyworse than that of the six DNNmodels even the ASR of NBRF and XGB are significantly greater than that of some DNNalgorithms The MDD of RF and XGB are significantly lessthat of MLP DBN and SAE the MDD of all traditional MLalgorithms are not significantly different from that of LSTMGRU and RNNThe ARR and ASR of all ML algorithms aresignificantly greater than that of BAH and the benchmarkindex the MDD of any ML algorithm is significantly greaterthan that of the benchmark index but significantly less thanthat of BAH strategy

53 Comparative Analysis of Performance of Different TradingStrategies in CSICS The analysis methods of this part aresimilar to Section 52 From Table 14 we can see that the ARPR and F1 of MLP are the greatest in all trading algorithmsThe RR AUC WR and ASR of LR are the greatest inall trading algorithms respectively The ARR of NB is the

Mathematical Problems in Engineering 13

Table 15Multiple comparison analysis between theARof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 01857GRU 00000 00000 00000 04439 10000CART 00000 00000 00000 09765 00024 00131NB 00000 00001 00002 00022 00000 00000 01810RF 00000 00002 00005 00007 00000 00000 00941 10000LR 00000 00000 00000 00076 00000 00000 03454 10000 10000SVM 00217 00766 01309 00000 00000 00000 00003 08314 09352 06360XGB 00000 00001 00001 00025 00000 00000 01930 10000 10000 10000 08168

Table 16Multiple comparison analysis between the PRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 09906 09781NB 00000 00000 00000 00000 01716 01234 08940RF 00000 00000 00000 00000 00319 00205 05271 10000LR 00000 00000 00000 00000 10000 10000 09951 02099 00422SVM 00000 00000 00000 01157 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00000 09922 09811 10000 08836 05086 09960 00000

highest in all trading strategies The MDD of CSI 300 index(benchmark index) is the smallest in all trading strategiesTheWRARR and ASR of all ML algorithms are greater thanthose of the benchmark index and BAH strategy

(1) Through the hypothesis test analysis of H1a and H1bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the AR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 15The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 15 we can see that the AR ofMLPDBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms except for SVM The ARof GRU is significantly smaller than that of all traditional MLalgorithms There is no significant difference between the ARof any two traditional ML algorithms except for CART andSVM

(2) Through the hypothesis test analysis of H2a and H2bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the PR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 16 The number in the tableis a p value of any two algorithms of Nemenyi test FromTables 14 and 16 we can see that the PR of MLP DBN and

SAE are significantly greater than that of all other tradingalgorithms and the PR of MLP DBN and SAE have nosignificant difference The PR of SVM is significantly greaterthan that of all other traditional ML algorithms which haveno significant difference between any two algorithms exceptfor SVM The PR of RNN is significantly greater than thatof all traditional ML algorithms except for SVM The PR ofGRU and LSTM are not significantly different from that of alltraditional ML algorithms except for SVM and LR

(3) Through the hypothesis test analysis of H3a and H3bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the RR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 17 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 17 we can see that the RR of all DNN models arenot significantly different There is no significant differenceamong the RR of all traditional ML algorithms The RR ofRNN GRU and LSTM are significantly smaller than that ofany traditional ML algorithm except for CART

(4) Through the hypothesis test analysis of H4a and H4bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the F1 of all trading algorithms There-fore we need to do further multiple comparative analysis and

14 Mathematical Problems in Engineering

Table 17Multiple comparison analysis between the RRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 09996 09996 10000LSTM 09309 09314 09781 09999GRU 09660 09663 09916 10000 10000CART 09744 09742 09225 05809 01509 02138NB 01093 01088 00574 00075 00004 00007 08861RF 00537 00534 00260 00028 00001 00002 07544 10000LR 00330 00328 00152 00015 00001 00001 06498 10000 10000SVM 03444 03434 02170 00434 00033 00059 09920 10000 09998 09991XGB 00193 00192 00085 00007 00000 00000 05344 10000 10000 10000 09960

Table 18 Multiple comparison analysis between the F1 of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 07211 06670NB 00000 00000 00000 00136 00132 00099 08664RF 00000 00000 00000 00786 00016 00011 05162 10000LR 00000 00000 00000 00000 09440 09208 10000 05675 02181SVM 00000 00000 00000 00178 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00001 03138 02679 10000 09937 08849 09964 00000

Table 19 Multiple comparison analysis between the AUC of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 09999 10000RNN 09945 09985 10000LSTM 05273 06382 09259 09937GRU 08448 09102 09958 10000 10000CART 06921 05835 02356 00801 00014 00096NB 00002 00001 00000 00000 00000 00000 02616RF 00001 00001 00000 00000 00000 00000 02002 10000LR 00000 00000 00000 00000 00000 00000 00930 10000 10000SVM 00027 00014 00001 00000 00000 00000 06454 10000 09999 09980XGB 00000 00000 00000 00000 00000 00000 01257 10000 10000 10000 09993

the results are shown in Table 18The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 18 we can see that the F1 of MLP DBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms There is no significantdifference among traditionalML algorithms except SVM andthe F1 of SVM is significantly greater than that of all othertraditional ML algorithms

(5) Through the hypothesis test analysis of H5a and H5bwe can obtain p valuelt22e-16Therefore there are significantdifferences between theAUCof all trading algorithmsThere-fore we need to do further multiple comparative analysis andthe results are shown in Table 19 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 19 we can see that the AUC of all DNN models haveno significant difference There is no significant difference

Mathematical Problems in Engineering 15

Table 20 Multiple comparison analysis between the WR of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 04117MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00002 00006 00000LSTM 00000 00000 00000 00000 00000 09772GRU 00000 00000 00000 00000 00000 09911 10000CART 09931 00000 00000 00000 00000 00000 00000 00000NB 00031 00000 00001 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00205 06437 05358 00000 00000LR 00000 00000 00000 00000 00000 00010 01611 01105 00000 00000 10000SVM 00000 00000 00000 00000 00000 09914 10000 10000 00000 00000 05322 01090XGB 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000

Table 21Multiple comparison analysis between theARRof any two trading strategiesThepvalue of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00007MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 04790 06355 07182LSTM 00000 00000 02512 03806 04630 10000GRU 00000 00000 02235 03454 04249 10000 10000CART 00000 00000 08301 09217 09542 10000 09999 09998NB 00000 00000 10000 10000 10000 02920 01295 01125 06517RF 00000 00000 00020 00048 00076 08705 09735 09806 05393 00006LR 00000 00000 02058 03222 03995 10000 10000 10000 09996 01019 09845SVM 00000 00000 10000 00803 01114 09993 10000 10000 09659 00165 09999 10000XGB 00000 00000 10000 00333 00484 09916 09997 09998 08789 00057 10000 09999 10000

between the AUC of all traditional ML algorithms TheAUC of all traditional ML algorithms except for CART aresignificantly greater than that of any DNN model There isno significant difference among the AUC ofMLP SAE DBNRNN and CART

(6)Through the hypothesis test analysis of H6a and H6bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the WR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 20 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 20 we can see that the WR of BAH and benchmarkindex have no significant difference but they are significantlysmaller than that of anyML algorithmTheWRofMLPDBNand SAE are significantly smaller than that of the other trad-ing algorithms but there is no significant difference betweenthe WR of MLP DBN and SAE The WR of LSTM andGRU have no significant difference but they are significantlysmaller than that of XGB and significantly greater than that of

CART and NB In traditional MLmodels the WR of NB andCART are significantly smaller than that of other algorithmsThe WR of XGB is significantly greater than that of all otherML algorithms

(7)Through the analysis of the hypothesis test of H7a andH7b we obtain p valuelt22e-16

Therefore there are significant differences between theARR of all trading strategies including the benchmark indexand BAH strategy Therefore we need to do further multiplecomparative analysis and the results are shown in Table 21FromTables 14 and 21 we can see that ARR of the benchmarkindex and BAH are significantly smaller than that of alltrading algorithms The ARR of MLP is significantly higherthan that of RF but there is no significant difference betweenMLP and other algorithms The ARR of SAE and DBN aresignificantly higher than that of RF and XGB but they arenot significantly different fromARR of other algorithms TheARR of NB is significantly higher than that of RF SVMand XGB But otherwise there is no significant difference

16 Mathematical Problems in Engineering

Table 22Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 08877MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 09099 08862 08114LSTM 00000 00000 03460 03080 02239 09999GRU 00000 00000 02132 01853 01270 09981 10000CART 00000 00000 00158 00195 00327 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000 00000 07298RF 00000 00000 10000 10000 10000 09968 07444 05789 00018 00000LR 00000 00000 01181 01003 00650 09879 10000 10000 00000 00000 04044SVM 00000 00000 10000 10000 10000 09849 05952 04238 00042 00000 10000 02704XGB 00000 00000 09937 09902 09746 10000 09878 09532 00001 00000 10000 08723 09998

Table 23 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00006DBN 00000 00004 10000SAE 00000 00023 10000 10000RNN 00000 00000 00320 00421 00111LSTM 00000 00000 00002 00003 00000 09947GRU 00000 00000 00001 00001 00000 09767 10000CART 00000 00000 01238 01538 00521 10000 09241 08305NB 00000 01875 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 01180 01469 00493 10000 09298 08401 10000 00000LR 00000 00000 00001 00002 00000 09881 10000 10000 08821 00000 08898SVM 00000 00000 03285 03839 01701 09999 07011 05424 10000 00000 10000 06216XGB 00000 00000 00308 00405 00106 10000 09951 09783 10000 00000 10000 09890 09998

between any other two algorithms Therefore the ARR ofmost traditional ML models are not significantly worse thanthat of the best DNNmodel

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore There are significantdifferences betweenASRof all trading strategies including thebenchmark index and BAH strategy The results of multiplecomparative analysis are shown in Table 22 From Tables 14and 22 we can see that the ASR of the benchmark indexand BAH are significantly smaller than that of all tradingalgorithms The ASR of all ML algorithms are significantlyhigher than that of CART and NB but there is no significantdifference between the ASR of CART and NB Beyond thatthere is no significant difference between any other twoalgorithms Therefore the ASR of all traditional ML modelsexcept NB and CART are not significantly worse than that ofany DNNmodel

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between the MDD of these trading strategies

including the benchmark index and the BAH strategyThe results of multiple comparative analysis are shown inTable 23 From Tables 14 and 23 we can see that the MDDof the benchmark index is significantly smaller than that ofother trading strategies including BAH strategy TheMDD ofBAH is significantly greater than that of all trading algorithmsexcept NBTheMDDofMLPDBN and SAE are significantlylower than that of NB but significantly higher than thatof RNN LSTM GRU LR and XGB The MDD of NB issignificantly greater than that of all other trading algorithmsBeyond that there is no significant difference between anyother two algorithms Therefore all ML algorithms expectNB especially LSTM RNN GRU LR and XGB can play arole in controlling trading risk

In a word some DNN models such as MLP DBN andSAE have good performance in AR PR and F1 traditionalML algorithms such as LR and XGB have good performanceinAUCandWRTheARRof some traditionalML algorithmssuch as CART NB LR and SVM are not significantlydifferent from that of the six DNN models The ASR of the

Mathematical Problems in Engineering 17

six DNN algorithms are not significantly different from alltraditional ML models except NB and CART The MDD ofLR and XGB are significantly smaller than those of MLPDBN and SAE and are not significantly different fromthat of LSTM GRU and RNN The ARR and ASR of allML algorithms are significantly greater than those of BAHand benchmark index the MDD of all ML algorithms aresignificantly smaller than that of the benchmark index butsignificantly greater than that of BAH strategy

From the above analysis and evaluation we can see thatthe directional evaluation indicators of some DNN modelsare very competitive in CSICS while the indicators of sometraditional ML algorithms have excellent performance inSPICS Whether in SPICS or CSICS the ARR and ASR ofall ML algorithms are significantly greater than that of thebenchmark index and BAH strategy respectively In all MLalgorithms there are always some traditional ML algorithmswhich are not significantly worse than the best DNN modelfor any performance evaluation indicator (ARR ASR andMDD)Therefore if we do not consider transaction cost andother factors affecting trading performance of DNN modelsare alternative but not the best choice when they are appliedto stock trading

In the same period the ARR of any ML algorithm inCSICS is significantly greater than that of the same algorithmin SPICS (p valuelt0001 in theNemenyi test)Meanwhile theMDD of any ML algorithm in CSICS is significantly greaterthan that of the same algorithm in SPICS (p value lt0001in the Nemenyi test) The results show that the quantitativetrading algorithms can more easily obtain excess returns inthe Chinese A-share market but the volatility risk of tradingin Chinese A-share market is significantly higher than that ofthe US stock market in the past 8 years

6 The Impact of Transaction Cost onPerformance of ML Algorithms

Trading cost can affect the profitability of a stock tradingstrategy Transaction cost that can be ignored in long-termstrategies is significantly magnified in daily trading Howevermany algorithmic trading studies assume that transactioncost does not exist ([10 17] etc) In practice frictions suchas transaction cost can distort the market from the perfectmodel in textbooks The cost known prior to trading activityis referred to as transparent such as commissions exchangefees and taxes The costs that has to be estimated are knownas implicit including comprise bid-ask spread latency orslippage and related market impact This section focuses onthe transparent and implicit cost and how do they affecttrading performance in daily trading

61 Experimental Settings and Backtesting Algorithm In thispart the transparent transaction cost is calculated by a certainpercentage of transaction turnover for convenience theimplicit transaction cost is very complicated in calculationand it is necessary to make a reasonable estimate for therandom changes of market environment and stock pricesTherefore we only discuss the impact of slippage on tradingperformance

The transaction cost structures of American stocks aresimilar to that of Chinese A-shares We assume that transpar-ent transaction cost is calculated by a percentage of turnoversuch as less than 05 [40 41] and 02 and 05 in theliterature [42] It is different for the estimation of slippage

In some quantitative trading simulation software such asJoinQuant [43] and Abuquant [44] the slippage is set to 002The transparent transaction cost and implicit transaction costare charged in both directions when buying and selling Itis worth noting that the transparent transaction cost varieswith the different brokers while the implicit transaction costis related to market liquidity market information networkstatus trading software etc

We set slippages s = s0=0 s1=001 s2=002 s3=003s4=004 the transparent transaction cost c = c0=0 c1=0001c2=0002 c3=0003 c4=0004 c5=0005 For different s ccombinations we study the impact of different transactioncost structures on trading performance We assume thatbuying and selling positions are one unit so the turnover isthe corresponding stock price When buying stocks we notonly need to pay a certain percentage cost of the purchaseprice but also need to pay an uncertain slippage cost Thatis we need to pay a higher price than the real-time price119875119905minus1

when we are buying But when selling stocks we notonly need to pay a certain percentage cost of the sellingprice but also to pay an uncertain slippage cost Generallyspeaking we need to sell at a price lower than the real-timeprice 119875

119905 It is worth noting that our trading strategy is self-

financing If ML algorithms predict the continuous occur-rence of buying signals or selling signals ie |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 0 we will continue to hold or do nothingso the transaction cost at this time is 0 when |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 1 it is indicated that the position maybe changed from holding to selling or from empty positionto buying At this time we would pay transaction costdue to the trading operation Finally we get a real yieldis

119877119890119905119905le119862119897119900119904119890119875119903119894119888119890

119905minus 119862119897119900119904119890119875119903119894119888119890

119905minus1

119862119897119900119904119890119875119903119894119888119890119905minus1

119875119905= 119862119897119900119904119890119875119903119894119888119890

119905

lowast (1 minus 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816)

minus 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816

119875119905minus1

= 119862119897119900119904119890119875119903119894119888119890119905minus1

lowast (1 + 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816)

+ 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816

119877119890119905119905=119875119905minus 119875119905minus1

119875119905minus1

(5)

where 119862119897119900119904119890119875119903119894119888119890119905

denotes the 119905-th closing price119879119903119886119889119890119878119894119892119899119886119897

119905denotes the 119905-th trading signal 119875

119905denotes

the 119905-th executing price and 119877119890119905119905denotes the 119905-th return rate

We propose a backtesting algorithm with transaction costbased on the above analysis as is shown in Algorithm 3

18 Mathematical Problems in Engineering

Input TS TS is trading signals of a stocks s is slippagec c is transparent transaction cost

Output WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) WR=NULL ARR=NULL ASR=NULL MDD=NULL(3) for (i in 1 N) (4) Stock Data=Stock Code List[i](5) ClosePricet=Stock Data [ldquoClosing Pricerdquo](6) Pt =ClosePricet lowast(1-clowastabs(TSt-TSt-1)) - slowastabs(TSt-TSt-1)(7) Pt-1 =ClosePricetlowast(1+clowastabs(TSt-TSt-1)) + slowastabs(TSt-TSt-1)(8) Rett= (Pt- Pt-1) Pt Ret is the return rate series(9) TDRR=lag (TS)lowastRet TDRR is the daily return through trading(10) WR[i]=sum (TDRRgt0)sum(TDRR =0)(11) ARR[i]=Returnannualized (TDRR)(12) ASR[i]=SharpeRatioannualized (TDRR)(13) MDD[i]=maxDrawDown (TDRR)(14) WR=c (WR WR[i])(15) ARR=c (ARR ARR[i])(16) ASR=c (ASR ASR[i])(17) MDD=c (MDD MDD[i])(18) (19) return (WR ARR ASR MDD)

Algorithm 3 Backtesting algorithm with transaction cost in R language

62 Analysis of Impact of Transaction Cost on the TradingPerformance of SPICS Transaction cost is one of the mostimportant factors affecting trading performance In US stocktrading transparent transaction cost can be charged accord-ing to a fixed fee per order or month or a floating fee basedon the volume and turnover of each transaction Sometimescustomers can also negotiate with broker to determinetransaction cost The transaction cost charged by differentbrokers varies greatly Meanwhile implicit transaction costis not known beforehand and the estimations of them arevery complex Therefore we assume that the percentageof turnover is the transparent transaction cost for ease ofcalculation In the aspect of implicit transaction cost we onlyconsider the impact of slippage on trading performance

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 24 WR is decreasing with the increase oftransaction cost for any trading algorithm which is intuitiveWhen the transaction cost is set to (s c) = (004 0005) theWR of each algorithm is the lowest Compared with setting(s c) = (0 0) the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR and SVM to XGB are reduced by580 597 591 1583 1804 1395 2171 16042216 1854 1850 and 2597 respectively ThereforeMLP DBN and SAE are more tolerant to transaction costGenerally speaking the DNN models have stronger capacityto accommodate transaction cost than the traditional MLmodels From the single trading algorithm such as MLP ifwe do not consider slippage ie s=0 the average WR ofMLP is 05510 under transaction cost structures (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not considertransparent transaction cost ie c=0 the averageWRofMLP

is 05618 under transaction cost structures (s1 c0) (s2 c0)(s3 c0) (s4 c0) so transparent transaction cost has greaterimpact than slippageThroughmultiple comparative analysisthe WR under the transaction cost structure (s1 c0) is notsignificantly different from the WR without transaction costfor MLP DBN and SAETheWR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the WR under the transaction cost structure (s1 c0) (s2 c0) are not significantly different from theWRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 25 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the lowest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 4031 4157 and 4093 respectivelywhile the ARR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin accounts For a general setting of s and c ie (s c) = (0020003) ARR of MLP DBN and SAE decrease by 23262400 and 2361 respectively while the ARR of otheralgorithms decrease by more than 50 and that of CARTand XGB decrease bymore than 100ThereforeMLP DBNand SAE are more tolerant to high transaction cost Fromsingle trading algorithm such as RNN if we do not considerslippage ie s=0 the average ARR of RNN is 01434 under

Mathematical Problems in Engineering 19

Table24Th

eWRof

SPICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

05676

05680

05683

05843

05825

05844

05266

05930

05912

05859

05831

05891

(s0c1)

05615

05618

05621

05669

05626

05694

05052

05752

05663

05654

05630

05599

(s0c2)

05560

05560

05564

05507

05442

05553

04847

05585

05429

05463

05438

05324

(s0c3)

05507

05506

05510

05353

05269

05418

04652

05424

05205

05278

05253

05061

(s0c4)

05457

05454

05460

05206

05101

05289

044

7005277

04996

05105

05084

04818

(s0c5)

05410

05407

05412

05071

04946

05170

04303

05138

04803

04947

04924

04594

(s1c0)

056

49056

53056

5605778

05751

05785

05190

058

61058

2405782

05759

05788

(s1c1)

05594

05597

05600

05619

05571

05648

04991

05700

05597

05595

05574

05521

(s1c2)

05539

05539

05544

05458

05389

05508

04788

05534

05364

05406

05383

05249

(s1c3)

05487

05486

05491

05305

05215

05375

04597

05375

05141

05223

05200

04988

(s1c4)

05438

05436

05441

05163

05052

05249

044

1805231

04938

05054

05034

04750

(s1c5)

05394

05390

05396

05032

04902

05132

04255

05097

04751

04900

04880

04532

(s2c0)

05628

05631

05635

05729

056

9705741

05134

058

1105758

05726

05704

05713

(s2c1)

05573

05574

05578

05568

05515

05602

04931

05647

05527

05535

05515

05442

(s2c2)

05518

05518

05523

05408

05336

05463

04729

05482

05297

05349

05326

05172

(s2c3)

05469

05467

05472

05260

05164

05334

04543

05330

05082

05171

05150

04918

(s2c4)

05421

05417

05423

05120

05004

05209

04368

05187

04881

05004

04986

046

85(s2c5)

05377

05373

05379

04993

04858

05096

04209

05055

04699

04855

04835

044

73(s3c0)

05606

05609

05612

05678

05640

05694

05074

05759

05690

05668

05646

05635

(s3c1)

05552

05553

05558

05518

05460

05556

04872

05595

05460

05478

05459

05365

(s3c2)

05499

05498

05503

05362

05284

05422

046

7505434

05233

05295

05273

05099

(s3c3)

05450

05448

05453

05216

05114

05292

04491

05284

05020

05120

05098

04849

(s3c4)

05405

05401

05407

05080

04960

05172

04321

05146

04827

04959

04940

04622

(s3c5)

05362

05357

05363

04955

04816

05063

04166

05017

04651

04815

04793

044

17(s4c0)

05587

05589

05593

05630

05588

05652

05019

05710

05627

05613

05593

05562

(s4c1)

05533

05533

05537

05470

05407

05513

04815

05544

05395

05424

05404

05290

(s4c2)

05480

05479

05484

05316

05232

05380

04620

05386

05171

05242

05220

05026

(s4c3)

05432

05429

05435

05172

05067

05253

044

4005241

04964

05070

05051

04782

(s4c4)

05388

05384

05391

05041

04917

05137

04274

05106

04775

04914

04897

04564

(s4c5)

05347

05341

05347

04918

04774

05029

04123

04979

046

0204773

04752

04361

20 Mathematical Problems in Engineering

Table25Th

eARR

ofSP

ICSford

ailytradingwith

different

transactioncost

Ther

esultthatthere

isno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

03332

03296

03325

02943

02920

02934

03317

02975

03133

02942

03067

03041

(s0c1)

03128

030

8703118

02439

02327

02521

02266

02496

02384

02336

02400

02137

(s0c2)

02924

02879

02912

01936

01735

02108

01216

02017

01636

01731

01734

01234

(s0c3)

02721

02672

02706

01433

0114

301697

00168

01539

00889

01126

01070

00333

(s0c4)

02519

02464

02500

00931

00553

01285

-00878

01062

00143

00522

004

06-00567

(s0c5)

02316

02257

02294

00430

-00037

00875

-019

2400586

-00602

-0008

-00257

-014

66(s1c0)

03249

03212

03242

027

7802729

02794

029

53028

18028

9802747

028

5502762

(s1c1)

03046

03004

03035

02274

02136

02381

01902

02339

02149

02141

02188

01859

(s1c2)

02842

02796

02829

01771

01544

01969

00853

01861

01401

01536

01523

00957

(s1c3)

02639

02588

02623

01269

00953

01557

-00195

01383

00654

00931

00858

000

56(s1c4)

02437

02381

02417

00767

00363

0114

6-012

41009

06-00091

00328

00195

-00844

(s1c5)

02234

02174

02211

00266

-00226

00735

-02285

00430

-00836

-00275

-0046

8-01742

(s2c0)

03167

03129

03159

026

1302538

026

54025

89026

61026

6302551

026

43024

84(s2c1)

02964

02921

02952

02110

01946

02241

01539

02182

01914

01946

01977

01581

(s2c2)

0276

02713

02746

01607

01354

01829

00490

01704

0116

701341

01312

006

79(s2c3)

02557

02505

02540

0110

400763

01418

-00557

01227

004

2000737

006

47-00221

(s2c4)

02355

02298

02334

006

0300173

01007

-016

0300750

-00325

00134

-00016

-01120

(s2c5)

02153

02091

02129

00102

-00416

00597

-0264

700274

-010

69-00469

-00678

-02018

(s3c0)

030

85030

46030

7602448

02348

02514

02225

02504

02428

02356

02431

02206

(s3c1)

02881

02838

02869

01945

01756

02102

0117

502026

01680

01751

01765

01304

(s3c2)

02678

02630

02663

01442

01164

01690

00127

01548

00933

0114

601100

004

02(s3c3)

02476

02422

02457

00940

00574

01279

-00919

01071

00187

00543

00436

-00498

(s3c4)

02273

02215

02252

00439

-00016

00868

-019

6400595

-00558

-0006

-00227

-013

97(s3c5)

02071

02008

02047

-00062

-0060

5004

58-0300

800119

-013

02-00662

-00889

-02294

(s4c0)

03003

02962

02993

02284

02157

02374

01862

02348

02193

02161

02219

01929

(s4c1)

02799

02754

02786

01781

01565

01962

00813

01870

01445

01556

01554

01026

(s4c2)

02597

02547

02580

01278

00974

01551

-00235

01392

00699

00952

00889

00125

(s4c3)

02394

02339

02375

00776

00384

0114

0-012

8100915

-0004

700349

00226

-00774

(s4c4)

02192

02132

02169

00275

-00205

00729

-02326

00439

-00792

-00254

-00437

-016

73(s4c5)

01989

01926

01964

-00225

-00794

00319

-033

69-00037

-015

35-00856

-010

99-02570

Mathematical Problems in Engineering 21

the transaction cost structures (s0 c1) (s0 c2) (s0 c3) (s0c4) (s0 c5) if we do not consider transparent transactioncost ie c=0 the average ARR of RNN is 02531 under thetransaction cost structure (s1 c0) (s2 c0) (s3 c0) (s4c0) so transparent transaction cost has greater impact thanslippage Through multiple comparative analysis the ARRunder the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s0 c1) are not significantly different from the ARRwithout transaction cost for MLP DBN and SAE the ARRunder all other transaction cost structures are significantlysmaller than theARRwithout transaction cost For all tradingalgorithms except for MLP DBN and SAE the ARR underthe transaction cost structures (s1 c0) (s2 c0) are notsignificantly different from the ARR without transactioncost the ARR under all other transaction cost structures aresignificantly smaller than the ARR without transaction cost

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 26 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theASR of each algorithm is the lowest Compared with settingwithout transaction cost the ASR of MLP DBN and SAEreduce by 3997 4123 and 4066 respectively while theASR of other trading algorithms reduce by more than 90compared with the case of no transaction cost Thereforeexcessive transaction cost will significantly reduce ASR Fora general setting of s and c ie (s c) = (002 0003) theASR of MLP DBN and SAE decrease by 2262 2336and 2302 respectively while the ASR of other algorithmsdecrease by more than 50 the ASR of CART and XGBdecrease by more than 100Therefore MLP DBN and SAEare more tolerant to transaction cost From single tradingalgorithm such as NB if we do not consider slippage ies=0 the average ASR of NB is 08052 under the transactioncost structure (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5)if we do not consider transparent transaction cost ie c=0the average ASR of NB is 14182 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has greater impact than slippage Throughmultiple comparative analysis the ASR under the transactioncost structures (s1 c0) (s2 c0) (s3 c0) (s0 c1) are notsignificantly different from the ASR without transaction costfor MLP DBN and SAE the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the ASR under the transaction cost structures(s1 c0) (s2 c0) are not significantly different from the ASRwithout transaction cost the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 27 MDD increases with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the settings without transaction cost theMDD of MLP DBN and SAE increase by 932 1108 and

1032 respectively The MDD of other trading algorithmsincrease by more than 80 compared with those withoutconsidering transaction costTherefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 483 580 and 533respectively while the MDD of other algorithms increase bymore than 35 and theMDDofCART RF andXGB increasebymore than 100Therefore MLP DBN and SAE are moretolerant to transaction cost As awhole theDNNmodels havestronger capacity to accommodate transaction cost than thetraditional ML models From single trading algorithm suchas GRU if we do not consider slippage ie s=0 the averageMDD of GRU is 04459 under the transaction cost structures(s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do notconsider transparent transaction cost ie c=0 the averageMDD of GRU is 03559 under the transaction cost structures(s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparent transactioncost has greater impact than slippage Through multiplecomparative analysis the MDD under any the transactioncost structure is not significantly different from the MDDwithout transaction cost for MLP DBN and SAE For alltrading algorithms except for MLP DBN and SAE such asLR the MDD under the transaction cost structures (s0 c1)(s1 c0) (s2 c0) (s3 c0) are not significantly different fromthe MDD without transaction cost the MDD under all othertransaction cost structures are significantly greater than theMDD without transaction cost

Through the analysis of the Table 27 performance eval-uation indicators we find that trading performance afterconsidering transaction cost will be worse than that withoutconsidering transaction cost as is in actual trading situationIt is noteworthy that the performance changes of DNNalgorithms especially MLP DBN and SAE are very smallafter considering transaction cost This shows that the threealgorithms have good tolerance to changes of transactioncost Especially for the MDD of the three algorithms thereis no significant difference with that with no transactioncost So we can consider applying them in actual tradingMeanwhile we conclude that the transparent transactioncost has greater impact on the trading performances thanthe slippage for SPICS This is because the prices of SPICSare too high when the transparent transaction cost is setto a certain percentage of turnover In actual transactionsspecial attention needs to be paid to the fact that the trans-action performance under most transaction cost structuresis significantly lower than the trading performance withoutconsidering transaction cost It is worth noting that theperformance of traditional ML algorithm is not worse thanthat ofDNNalgorithmswithout considering transaction costwhile the performance of DNN algorithms is better than thatof traditional ML algorithms after considering transactioncost

63 Analysis of Impact of Transaction Cost on the TradingPerformance of CSICS Similar to Section 62 we will discussthe impact of transaction cost on trading performance ofCSICS in the followings In the Chinese A-share marketthe transparent transaction cost is usually set to a certain

22 Mathematical Problems in Engineering

Table26Th

eASR

ofSP

ICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

1546

815

412

15502

15764

15571

15828

13927

16237

16763

15818

16018

16298

(s0c1)

1456

214

478

14577

1300

012

317

13565

09346

13554

12650

12472

12456

11294

(s0c2)

13639

13527

13635

10191

09015

11262

04657

10822

08482

09074

08846

06236

(s0c3)

12702

12561

12679

07355

05690

08929

-00085

08061

04298

05652

05216

0118

2(s0c4)

11751

11581

11709

04511

02366

06580

-04823

05291

00139

02234

01596

-03812

(s0c5)

1079

10591

10728

01678

-00931

04227

-09500

02534

-039

59-01152

-019

87-08696

(s1c0)

15121

1505

715

149

1492

714

606

15119

1244

915

424

1558

214

825

14974

1488

6(s1c1)

14208

14116

14217

12146

11334

12841

07823

12722

1144

711459

11394

09859

(s1c2)

13279

13159

13270

09325

08020

10526

03105

09977

07267

08048

07772

04792

(s1c3)

12337

12188

12308

064

8204690

08185

-016

4607209

03082

04622

04139

-00257

(s1c4)

11382

11204

11333

03637

01368

05831

-06374

04438

-010

6801208

00524

-052

31(s1c5)

10417

10210

10348

00807

-019

2003478

-110

2501686

-05146

-02169

-0304

7-10083

(s2c0)

1477

1469

914

792

1408

113

632

1440

310

946

1460

114

390

1382

213

922

1346

2(s2c1)

13851

13752

13854

11285

10343

12111

06283

11883

10237

10439

10325

08416

(s2c2)

12916

12789

12901

08454

07021

09785

01547

09128

060

4907019

06696

03346

(s2c3)

11969

11812

11934

05607

03688

07437

-032

0506355

01868

03591

03063

-016

90(s2c4)

11010

10825

10955

02763

00372

05081

-07916

03586

-02268

00183

-00545

-06639

(s2c5)

1004

109827

09967

-0006

-02905

02729

-12533

00841

-06323

-031

79-04101

-114

54(s3c0)

14415

14337

14432

13227

12650

13679

09425

13770

13189

12810

12862

12030

(s3c1)

13490

13384

13488

10419

09348

11375

04733

11039

09023

09413

09252

06971

(s3c2)

12551

12416

12529

07580

060

19090

40-00013

08275

04832

05988

05618

01904

(s3c3)

11599

11435

11558

04731

02688

066

88-04757

05500

00658

02562

01988

-031

16(s3c4)

10636

10443

10575

01891

-00620

04331

-0944

202735

-0346

0-00836

-016

08-08034

(s3c5)

09664

09443

09584

-00924

-03883

01982

-14018

000

00-074

89-04183

-05146

-12808

(s4c0)

14058

13972

1406

812

368

11662

12950

07892

12933

11983

11793

11796

10591

(s4c1)

13127

13013

13119

09549

08350

10634

03180

10190

07807

08386

08177

05527

(s4c2)

12183

1204

12155

06705

05018

08293

-015

6807421

03617

04958

04542

004

68(s4c3)

11226

11055

11179

03857

01691

05938

-06295

046

47-00545

01537

00918

-04529

(s4c4)

1026

1006

10193

01021

-016

0703582

-10948

01888

-0464

2-018

49-02665

-09413

(s4c5)

09286

09057

09199

-017

83-04853

01238

-15478

-00836

-0864

2-05177

-06182

-14142

Mathematical Problems in Engineering 23

Table 27 The MDD of SPICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 03583 03584 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338(s0 c1) 03629 03638 03594 03779 03986 03636 04072 03712 03843 03963 03972 04203(s0 c2) 03677 03695 03647 04302 04707 03968 05168 04127 04842 04729 04787 05735(s0 c3) 03727 03756 03703 04990 05639 04376 06564 04709 06172 05682 05844 07335(s0 c4) 03781 03821 03764 05767 06612 04873 07804 05424 07377 06653 06913 08447(s0 c5) 03839 03890 03828 06529 0746 05444 08730 06162 08272 07501 07808 09118(s1 c0) 03596 03600 03560 03500 036130 03446 03574 03502 03414 03585 03569 03540(s1 c1) 03642 03655 03609 03907 04156 03717 04320 03814 04067 04154 04170 04541(s1 c2) 03691 03712 03662 04466 04936 04066 05534 04270 05172 04971 05049 06168(s1 c3) 03742 03774 03720 05183 05895 04495 06928 04885 06499 05937 06129 07662(s1 c4) 03796 03839 03781 05961 06842 05013 08105 05610 07631 06884 07161 08649(s1 c5) 03856 03909 03847 0671 07646 05595 08946 06342 08451 07691 0800 09235(s2 c0) 03609 03615 03573 03607 03756 03517 03770 03586 03586 03739 03727 03787(s2 c1) 03656 03671 03623 04047 04349 03805 04627 03929 04339 04365 04397 04929(s2 c2) 03705 03729 03678 04642 05176 04171 05916 04424 05504 05218 05327 06577(s2 c3) 03756 03792 03736 05377 06143 04624 07277 05067 06805 06183 06402 07939(s2 c4) 03812 03859 03799 06155 07056 05161 08380 05796 07856 07099 07388 08816(s2 c5) 03873 03930 03866 06887 07816 05751 09126 06517 08606 07864 08172 09331(s3 c0) 03622 03631 03588 03729 03912 03594 04004 03685 03795 03909 03909 04081(s3 c1) 03669 03687 03639 04200 04555 03901 04966 04062 04622 04587 04642 05334(s3 c2) 03719 03746 03694 04826 05423 04286 06295 04589 05833 05465 05607 06936(s3 c3) 03772 03811 03754 05572 06377 04762 07609 05248 07081 06420 06657 08175(s3 c4) 03829 03879 03818 06341 07254 05314 08620 05980 08054 07300 07593 08956(s3 c5) 03894 03954 03888 07056 07972 05909 09275 06689 08740 08022 08325 09412(s4 c0) 03635 03647 03602 03861 04082 03678 04274 03798 04015 04096 04114 04396(s4 c1) 03683 03704 03654 04362 04774 04005 05325 04211 04908 04814 04894 05730(s4 c2) 03734 03765 03712 05013 05664 04410 06667 04758 06142 05707 05875 07253(s4 c3) 03790 03833 03775 05765 06600 04905 07906 05429 07330 06644 06894 08375(s4 c4) 03851 03904 03841 06521 07439 05470 08824 06162 08230 07485 07782 09074(s4 c5) 03917 03981 03913 07218 08115 06067 09395 06857 08858 08165 08463 09480

percentage of turnover and it is the same as the assumptionin the experimental settings As in the US stock market thesmallest unit of price change is 001 (one tick) It is reasonableto set slippage to be 001-005 Of course it should be notedthat the prices fluctuation may be more intense when closingthan that in the middle of a trading day

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 28 the WR is decreasing with the increaseof transaction cost for any trading algorithm When thetransaction cost is set to (s c) = (004 0005) the WR of eachalgorithm is the smallest Comparedwith the settings withouttransaction cost the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR SVM and XGB are reduced by671 688 697 2269 1726 1548 2430 14912484 2112 2112 and 2919 respectively For a generalsetting of s and c ie (s c) = (002 0003) the WR ofMLP DBN and SAE decrease by 410 420 and 430respectively while the WR of other algorithms decrease bymore than 9 the WR of CART RF and XGB decrease by

more than 15 Therefore MLP DBN and SAE are moretolerant to transaction cost From single trading algorithmsuch as LSTM if we do not consider slippage ie s=0 theaverage WR of DBN is 05417 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage WR of LSTM is 05304 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the WR under the transactioncost structures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the WR without transaction cost for MLPDBN SAE and NB the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN SAE and NB the WR under the transaction coststructure (s0 c1) is not significantly different from the WRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

24 Mathematical Problems in Engineering

Table 28 The WR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803(s0 c1) 05523 05527 05525 05525 05608 05620 05009 05227 05612 05665 05571 05595(s0 c2) 05488 05492 05489 05389 05512 05535 04879 05149 05460 05542 05445 05411(s0 c3) 05453 05456 05452 05258 05414 05451 04747 05068 05313 05418 05320 05234(s0 c4) 05417 05419 05414 05127 05320 05368 04622 04991 05172 05297 05202 05067(s0 c5) 05383 05383 05379 05004 05230 05286 04504 04917 05036 05180 05088 04905(s1 c0) 05494 05499 05497 05444 05541 05558 04925 05170 05520 05584 05492 05488(s1 c1) 05456 05459 05456 05286 05424 05456 04775 05080 05342 05437 05345 05275(s1 c2) 05421 05423 05420 05161 05335 05377 04654 05007 05207 05320 05231 05110(s1 c3) 05386 05388 05383 05036 05246 05296 04530 04931 05065 05205 05116 04946(s1 c4) 05353 05354 05349 04915 05156 05218 04419 04861 04937 05095 05007 04795(s1 c5) 05323 05323 05317 04808 05076 05148 04315 04796 04817 04995 04905 04652(s2 c0) 05431 05434 05431 05219 05368 05403 04707 05036 05269 05374 05286 05189(s2 c1) 05395 05397 05393 05078 05266 05314 04573 04956 05115 05242 05154 05005(s2 c2) 05360 05361 05357 04960 05181 05237 04458 04886 04985 05134 05046 04853(s2 c3) 05331 05331 05326 04850 05100 05167 04352 04818 04864 05031 04945 04711(s2 c4) 05300 05300 05293 04743 05018 05093 04252 04752 04746 04931 04846 04572(s2 c5) 05273 05271 05266 04648 04946 05029 04159 04692 04639 04838 04755 04445(s3 c0) 05373 05374 05371 05019 05216 05265 04514 04917 05049 05186 05098 04932(s3 c1) 05341 05341 05336 04902 05128 05188 04399 04846 04917 05074 04990 04775(s3 c2) 05312 05312 05306 04798 05052 05122 04303 04782 04804 04977 04896 04644(s3 c3) 05281 05281 05275 04696 04976 05049 04206 04718 04689 04879 04799 04509(s3 c4) 05252 05251 05245 04598 04901 04984 04110 04657 04581 04785 04707 04378(s3 c5) 05226 05223 05218 04510 04833 04924 04023 04602 04481 04701 04621 04264(s4 c0) 05325 05325 05321 04860 05089 05150 04360 04816 04870 05030 04949 04723(s4 c1) 05294 05294 05289 04753 05010 05079 04258 04750 04752 04928 04849 04588(s4 c2) 05266 05265 05259 04653 04937 05013 04164 04690 04642 04838 04761 04458(s4 c3) 05238 05236 05230 04562 04864 04948 04073 04632 04541 04747 04672 04336(s4 c4) 05211 05208 05203 04475 04798 04891 03985 04577 04440 04662 04586 04218(s4 c5) 05186 05182 05176 04392 04733 04832 03901 04524 04348 04582 04509 04109

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 29 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the smallest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 5073 5175 and 5225 respectivelyWhile the ARR of other trading algorithms decrease bymore than 100 compared with those algorithms withouttransaction cost Therefore excessive transaction cost canlead to serious losses in the accounts For a general settingof s and c ie (s c) = (002 0003) ARR of MLP DBNand SAE decrease by 2741 2797 and 2825 respectivelywhile the ARR other algorithms decrease by more than 50and that of CART NB RF and XGB decrease by more than100 Therefore MLP DBN and SAE are more tolerant totransaction cost From single trading algorithm such as SAEif we do not consider slippage ie s=0 the average ARR ofSAE is 05040 under the transaction cost structure (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not consider

transparent transaction cost ie c=0 the averageARRof SAEis 04468 under the transaction cost structures (s1 c0) (s2c0) (s3 c0) (s4 c0) so transparent transaction cost hassmaller impact than slippage Through multiple comparativeanalysis the ARR under the transaction cost structures (s0c1) (s0 c2) (s0 c3) (s0 c1) (s1 c1) are not significantlydifferent from the ARR without transaction cost for MLPDBN and SAE the ARR under all other transaction coststructures are significantly smaller than the ARR withouttransaction cost For RNN LSTM GRU CART RF LR andSVM the ARR under the transaction cost structures (s0c1) (s0 c2) (s1 c0) are not significantly different fromthe ARR without transaction cost the ARR under all othertransaction cost structures are significantly smaller than theARR without transaction cost For NB and XGB the ARRunder the transaction cost structures (s0 c1) (s1 c0) arenot significantly different from the ARR without transactioncost the ARR under all other transaction cost structuresare significantly smaller than the ARR without transactioncost

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 12: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

12 Mathematical Problems in Engineering

Table 13 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00052DBN 00000 00031 10000SAE 00000 00012 10000 10000RNN 00000 00000 01645 02243 03556LSTM 00000 00000 06236 07173 08511 10000GRU 00000 00000 00245 00381 00760 10000 09860CART 00000 00000 01496 02057 03309 10000 10000 10000NB 00000 00000 00786 01136 01999 10000 09994 10000 10000RF 00000 00000 00002 00004 00012 08964 04248 09980 09109 09713LR 00000 00000 05451 06428 07935 10000 10000 09933 10000 09998 05015SVM 00000 00000 02433 03194 04734 10000 10000 09999 10000 10000 08155 10000XGB 00000 00000 00103 00167 00360 09998 09462 10000 09999 10000 09998 09685 09989

Table 14 Trading performance of different trading strategies in CSICS Best performance of all trading strategies is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGBAR mdash mdash 05175 05167 05163 05030 04993 04993 05052 05084 05090 05084 05112 05087PR mdash mdash 07548 07436 07439 05414 04964 04956 05022 05109 05128 04967 05695 05026RR mdash mdash 05252 05250 05248 05234 05224 05223 05279 05307 05311 05318 05295 05315F1 mdash mdash 06150 06108 06108 05320 05086 05082 05143 05192 05214 05132 05483 05164AUC mdash mdash 05027 05024 05020 05006 04995 04996 05049 05078 05082 05086 05074 05085WR 05222 05090 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803ARR 00633 02224 05731 05704 05678 05248 05165 05113 05534 06125 04842 05095 05004 04938ASR 02625 04612 14031 14006 13935 14880 15422 15505 12232 11122 14379 15582 14231 14698MDD 04808 06697 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632

are significantly greater than that of CART and significantlyless than that of RF but there is no significant differencebetweenRNN LSTM and other algorithmsTheASRofGRUis significantly greater than that of CART but there is nosignificant difference between GRU and other traditional MLalgorithms In all traditional ML algorithms the ASR of allalgorithms are significantly greater than that of CART butotherwise there is no significant difference between ASR ofany other two algorithms

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between MDD of trading strategies includingthe benchmark index and the BAH The results of multiplecomparative analysis are shown in Table 13 From Tables4 and 13 we can see that MDD of any ML algorithm issignificantly greater than that of the benchmark index butsignificantly smaller than that of BAH strategy The MDDof MLP and DBN are significantly smaller than those ofGRU RF and XGB but there is no significant differencebetween MLP DBN and other algorithms The MDD ofSAE is significantly smaller than that of XGB but there isno significant difference between SAE and other algorithmsOtherwise there is no significant difference betweenMDDofany other two algorithms

In a word the traditional ML algorithms such as NBRF and XGB have good performance in most directional

evaluation indicators such as AR PR and F1 The DNNalgorithms such as MLP have good performance in PR andARR In traditional ML algorithms the ARR of CART RFSVM and XGB are not significantly different from that ofMLP DBN and SAE the ARR of CART is significantlygreater than that of LSTM GRU and RNN but otherwisethe ARR of all traditional ML algorithms are not significantlyworse than that of LSTM GRU and RNN The ASR of alltraditional ML algorithms except CART are not significantlyworse than that of the six DNNmodels even the ASR of NBRF and XGB are significantly greater than that of some DNNalgorithms The MDD of RF and XGB are significantly lessthat of MLP DBN and SAE the MDD of all traditional MLalgorithms are not significantly different from that of LSTMGRU and RNNThe ARR and ASR of all ML algorithms aresignificantly greater than that of BAH and the benchmarkindex the MDD of any ML algorithm is significantly greaterthan that of the benchmark index but significantly less thanthat of BAH strategy

53 Comparative Analysis of Performance of Different TradingStrategies in CSICS The analysis methods of this part aresimilar to Section 52 From Table 14 we can see that the ARPR and F1 of MLP are the greatest in all trading algorithmsThe RR AUC WR and ASR of LR are the greatest inall trading algorithms respectively The ARR of NB is the

Mathematical Problems in Engineering 13

Table 15Multiple comparison analysis between theARof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 01857GRU 00000 00000 00000 04439 10000CART 00000 00000 00000 09765 00024 00131NB 00000 00001 00002 00022 00000 00000 01810RF 00000 00002 00005 00007 00000 00000 00941 10000LR 00000 00000 00000 00076 00000 00000 03454 10000 10000SVM 00217 00766 01309 00000 00000 00000 00003 08314 09352 06360XGB 00000 00001 00001 00025 00000 00000 01930 10000 10000 10000 08168

Table 16Multiple comparison analysis between the PRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 09906 09781NB 00000 00000 00000 00000 01716 01234 08940RF 00000 00000 00000 00000 00319 00205 05271 10000LR 00000 00000 00000 00000 10000 10000 09951 02099 00422SVM 00000 00000 00000 01157 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00000 09922 09811 10000 08836 05086 09960 00000

highest in all trading strategies The MDD of CSI 300 index(benchmark index) is the smallest in all trading strategiesTheWRARR and ASR of all ML algorithms are greater thanthose of the benchmark index and BAH strategy

(1) Through the hypothesis test analysis of H1a and H1bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the AR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 15The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 15 we can see that the AR ofMLPDBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms except for SVM The ARof GRU is significantly smaller than that of all traditional MLalgorithms There is no significant difference between the ARof any two traditional ML algorithms except for CART andSVM

(2) Through the hypothesis test analysis of H2a and H2bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the PR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 16 The number in the tableis a p value of any two algorithms of Nemenyi test FromTables 14 and 16 we can see that the PR of MLP DBN and

SAE are significantly greater than that of all other tradingalgorithms and the PR of MLP DBN and SAE have nosignificant difference The PR of SVM is significantly greaterthan that of all other traditional ML algorithms which haveno significant difference between any two algorithms exceptfor SVM The PR of RNN is significantly greater than thatof all traditional ML algorithms except for SVM The PR ofGRU and LSTM are not significantly different from that of alltraditional ML algorithms except for SVM and LR

(3) Through the hypothesis test analysis of H3a and H3bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the RR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 17 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 17 we can see that the RR of all DNN models arenot significantly different There is no significant differenceamong the RR of all traditional ML algorithms The RR ofRNN GRU and LSTM are significantly smaller than that ofany traditional ML algorithm except for CART

(4) Through the hypothesis test analysis of H4a and H4bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the F1 of all trading algorithms There-fore we need to do further multiple comparative analysis and

14 Mathematical Problems in Engineering

Table 17Multiple comparison analysis between the RRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 09996 09996 10000LSTM 09309 09314 09781 09999GRU 09660 09663 09916 10000 10000CART 09744 09742 09225 05809 01509 02138NB 01093 01088 00574 00075 00004 00007 08861RF 00537 00534 00260 00028 00001 00002 07544 10000LR 00330 00328 00152 00015 00001 00001 06498 10000 10000SVM 03444 03434 02170 00434 00033 00059 09920 10000 09998 09991XGB 00193 00192 00085 00007 00000 00000 05344 10000 10000 10000 09960

Table 18 Multiple comparison analysis between the F1 of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 07211 06670NB 00000 00000 00000 00136 00132 00099 08664RF 00000 00000 00000 00786 00016 00011 05162 10000LR 00000 00000 00000 00000 09440 09208 10000 05675 02181SVM 00000 00000 00000 00178 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00001 03138 02679 10000 09937 08849 09964 00000

Table 19 Multiple comparison analysis between the AUC of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 09999 10000RNN 09945 09985 10000LSTM 05273 06382 09259 09937GRU 08448 09102 09958 10000 10000CART 06921 05835 02356 00801 00014 00096NB 00002 00001 00000 00000 00000 00000 02616RF 00001 00001 00000 00000 00000 00000 02002 10000LR 00000 00000 00000 00000 00000 00000 00930 10000 10000SVM 00027 00014 00001 00000 00000 00000 06454 10000 09999 09980XGB 00000 00000 00000 00000 00000 00000 01257 10000 10000 10000 09993

the results are shown in Table 18The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 18 we can see that the F1 of MLP DBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms There is no significantdifference among traditionalML algorithms except SVM andthe F1 of SVM is significantly greater than that of all othertraditional ML algorithms

(5) Through the hypothesis test analysis of H5a and H5bwe can obtain p valuelt22e-16Therefore there are significantdifferences between theAUCof all trading algorithmsThere-fore we need to do further multiple comparative analysis andthe results are shown in Table 19 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 19 we can see that the AUC of all DNN models haveno significant difference There is no significant difference

Mathematical Problems in Engineering 15

Table 20 Multiple comparison analysis between the WR of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 04117MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00002 00006 00000LSTM 00000 00000 00000 00000 00000 09772GRU 00000 00000 00000 00000 00000 09911 10000CART 09931 00000 00000 00000 00000 00000 00000 00000NB 00031 00000 00001 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00205 06437 05358 00000 00000LR 00000 00000 00000 00000 00000 00010 01611 01105 00000 00000 10000SVM 00000 00000 00000 00000 00000 09914 10000 10000 00000 00000 05322 01090XGB 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000

Table 21Multiple comparison analysis between theARRof any two trading strategiesThepvalue of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00007MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 04790 06355 07182LSTM 00000 00000 02512 03806 04630 10000GRU 00000 00000 02235 03454 04249 10000 10000CART 00000 00000 08301 09217 09542 10000 09999 09998NB 00000 00000 10000 10000 10000 02920 01295 01125 06517RF 00000 00000 00020 00048 00076 08705 09735 09806 05393 00006LR 00000 00000 02058 03222 03995 10000 10000 10000 09996 01019 09845SVM 00000 00000 10000 00803 01114 09993 10000 10000 09659 00165 09999 10000XGB 00000 00000 10000 00333 00484 09916 09997 09998 08789 00057 10000 09999 10000

between the AUC of all traditional ML algorithms TheAUC of all traditional ML algorithms except for CART aresignificantly greater than that of any DNN model There isno significant difference among the AUC ofMLP SAE DBNRNN and CART

(6)Through the hypothesis test analysis of H6a and H6bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the WR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 20 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 20 we can see that the WR of BAH and benchmarkindex have no significant difference but they are significantlysmaller than that of anyML algorithmTheWRofMLPDBNand SAE are significantly smaller than that of the other trad-ing algorithms but there is no significant difference betweenthe WR of MLP DBN and SAE The WR of LSTM andGRU have no significant difference but they are significantlysmaller than that of XGB and significantly greater than that of

CART and NB In traditional MLmodels the WR of NB andCART are significantly smaller than that of other algorithmsThe WR of XGB is significantly greater than that of all otherML algorithms

(7)Through the analysis of the hypothesis test of H7a andH7b we obtain p valuelt22e-16

Therefore there are significant differences between theARR of all trading strategies including the benchmark indexand BAH strategy Therefore we need to do further multiplecomparative analysis and the results are shown in Table 21FromTables 14 and 21 we can see that ARR of the benchmarkindex and BAH are significantly smaller than that of alltrading algorithms The ARR of MLP is significantly higherthan that of RF but there is no significant difference betweenMLP and other algorithms The ARR of SAE and DBN aresignificantly higher than that of RF and XGB but they arenot significantly different fromARR of other algorithms TheARR of NB is significantly higher than that of RF SVMand XGB But otherwise there is no significant difference

16 Mathematical Problems in Engineering

Table 22Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 08877MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 09099 08862 08114LSTM 00000 00000 03460 03080 02239 09999GRU 00000 00000 02132 01853 01270 09981 10000CART 00000 00000 00158 00195 00327 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000 00000 07298RF 00000 00000 10000 10000 10000 09968 07444 05789 00018 00000LR 00000 00000 01181 01003 00650 09879 10000 10000 00000 00000 04044SVM 00000 00000 10000 10000 10000 09849 05952 04238 00042 00000 10000 02704XGB 00000 00000 09937 09902 09746 10000 09878 09532 00001 00000 10000 08723 09998

Table 23 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00006DBN 00000 00004 10000SAE 00000 00023 10000 10000RNN 00000 00000 00320 00421 00111LSTM 00000 00000 00002 00003 00000 09947GRU 00000 00000 00001 00001 00000 09767 10000CART 00000 00000 01238 01538 00521 10000 09241 08305NB 00000 01875 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 01180 01469 00493 10000 09298 08401 10000 00000LR 00000 00000 00001 00002 00000 09881 10000 10000 08821 00000 08898SVM 00000 00000 03285 03839 01701 09999 07011 05424 10000 00000 10000 06216XGB 00000 00000 00308 00405 00106 10000 09951 09783 10000 00000 10000 09890 09998

between any other two algorithms Therefore the ARR ofmost traditional ML models are not significantly worse thanthat of the best DNNmodel

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore There are significantdifferences betweenASRof all trading strategies including thebenchmark index and BAH strategy The results of multiplecomparative analysis are shown in Table 22 From Tables 14and 22 we can see that the ASR of the benchmark indexand BAH are significantly smaller than that of all tradingalgorithms The ASR of all ML algorithms are significantlyhigher than that of CART and NB but there is no significantdifference between the ASR of CART and NB Beyond thatthere is no significant difference between any other twoalgorithms Therefore the ASR of all traditional ML modelsexcept NB and CART are not significantly worse than that ofany DNNmodel

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between the MDD of these trading strategies

including the benchmark index and the BAH strategyThe results of multiple comparative analysis are shown inTable 23 From Tables 14 and 23 we can see that the MDDof the benchmark index is significantly smaller than that ofother trading strategies including BAH strategy TheMDD ofBAH is significantly greater than that of all trading algorithmsexcept NBTheMDDofMLPDBN and SAE are significantlylower than that of NB but significantly higher than thatof RNN LSTM GRU LR and XGB The MDD of NB issignificantly greater than that of all other trading algorithmsBeyond that there is no significant difference between anyother two algorithms Therefore all ML algorithms expectNB especially LSTM RNN GRU LR and XGB can play arole in controlling trading risk

In a word some DNN models such as MLP DBN andSAE have good performance in AR PR and F1 traditionalML algorithms such as LR and XGB have good performanceinAUCandWRTheARRof some traditionalML algorithmssuch as CART NB LR and SVM are not significantlydifferent from that of the six DNN models The ASR of the

Mathematical Problems in Engineering 17

six DNN algorithms are not significantly different from alltraditional ML models except NB and CART The MDD ofLR and XGB are significantly smaller than those of MLPDBN and SAE and are not significantly different fromthat of LSTM GRU and RNN The ARR and ASR of allML algorithms are significantly greater than those of BAHand benchmark index the MDD of all ML algorithms aresignificantly smaller than that of the benchmark index butsignificantly greater than that of BAH strategy

From the above analysis and evaluation we can see thatthe directional evaluation indicators of some DNN modelsare very competitive in CSICS while the indicators of sometraditional ML algorithms have excellent performance inSPICS Whether in SPICS or CSICS the ARR and ASR ofall ML algorithms are significantly greater than that of thebenchmark index and BAH strategy respectively In all MLalgorithms there are always some traditional ML algorithmswhich are not significantly worse than the best DNN modelfor any performance evaluation indicator (ARR ASR andMDD)Therefore if we do not consider transaction cost andother factors affecting trading performance of DNN modelsare alternative but not the best choice when they are appliedto stock trading

In the same period the ARR of any ML algorithm inCSICS is significantly greater than that of the same algorithmin SPICS (p valuelt0001 in theNemenyi test)Meanwhile theMDD of any ML algorithm in CSICS is significantly greaterthan that of the same algorithm in SPICS (p value lt0001in the Nemenyi test) The results show that the quantitativetrading algorithms can more easily obtain excess returns inthe Chinese A-share market but the volatility risk of tradingin Chinese A-share market is significantly higher than that ofthe US stock market in the past 8 years

6 The Impact of Transaction Cost onPerformance of ML Algorithms

Trading cost can affect the profitability of a stock tradingstrategy Transaction cost that can be ignored in long-termstrategies is significantly magnified in daily trading Howevermany algorithmic trading studies assume that transactioncost does not exist ([10 17] etc) In practice frictions suchas transaction cost can distort the market from the perfectmodel in textbooks The cost known prior to trading activityis referred to as transparent such as commissions exchangefees and taxes The costs that has to be estimated are knownas implicit including comprise bid-ask spread latency orslippage and related market impact This section focuses onthe transparent and implicit cost and how do they affecttrading performance in daily trading

61 Experimental Settings and Backtesting Algorithm In thispart the transparent transaction cost is calculated by a certainpercentage of transaction turnover for convenience theimplicit transaction cost is very complicated in calculationand it is necessary to make a reasonable estimate for therandom changes of market environment and stock pricesTherefore we only discuss the impact of slippage on tradingperformance

The transaction cost structures of American stocks aresimilar to that of Chinese A-shares We assume that transpar-ent transaction cost is calculated by a percentage of turnoversuch as less than 05 [40 41] and 02 and 05 in theliterature [42] It is different for the estimation of slippage

In some quantitative trading simulation software such asJoinQuant [43] and Abuquant [44] the slippage is set to 002The transparent transaction cost and implicit transaction costare charged in both directions when buying and selling Itis worth noting that the transparent transaction cost varieswith the different brokers while the implicit transaction costis related to market liquidity market information networkstatus trading software etc

We set slippages s = s0=0 s1=001 s2=002 s3=003s4=004 the transparent transaction cost c = c0=0 c1=0001c2=0002 c3=0003 c4=0004 c5=0005 For different s ccombinations we study the impact of different transactioncost structures on trading performance We assume thatbuying and selling positions are one unit so the turnover isthe corresponding stock price When buying stocks we notonly need to pay a certain percentage cost of the purchaseprice but also need to pay an uncertain slippage cost Thatis we need to pay a higher price than the real-time price119875119905minus1

when we are buying But when selling stocks we notonly need to pay a certain percentage cost of the sellingprice but also to pay an uncertain slippage cost Generallyspeaking we need to sell at a price lower than the real-timeprice 119875

119905 It is worth noting that our trading strategy is self-

financing If ML algorithms predict the continuous occur-rence of buying signals or selling signals ie |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 0 we will continue to hold or do nothingso the transaction cost at this time is 0 when |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 1 it is indicated that the position maybe changed from holding to selling or from empty positionto buying At this time we would pay transaction costdue to the trading operation Finally we get a real yieldis

119877119890119905119905le119862119897119900119904119890119875119903119894119888119890

119905minus 119862119897119900119904119890119875119903119894119888119890

119905minus1

119862119897119900119904119890119875119903119894119888119890119905minus1

119875119905= 119862119897119900119904119890119875119903119894119888119890

119905

lowast (1 minus 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816)

minus 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816

119875119905minus1

= 119862119897119900119904119890119875119903119894119888119890119905minus1

lowast (1 + 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816)

+ 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816

119877119890119905119905=119875119905minus 119875119905minus1

119875119905minus1

(5)

where 119862119897119900119904119890119875119903119894119888119890119905

denotes the 119905-th closing price119879119903119886119889119890119878119894119892119899119886119897

119905denotes the 119905-th trading signal 119875

119905denotes

the 119905-th executing price and 119877119890119905119905denotes the 119905-th return rate

We propose a backtesting algorithm with transaction costbased on the above analysis as is shown in Algorithm 3

18 Mathematical Problems in Engineering

Input TS TS is trading signals of a stocks s is slippagec c is transparent transaction cost

Output WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) WR=NULL ARR=NULL ASR=NULL MDD=NULL(3) for (i in 1 N) (4) Stock Data=Stock Code List[i](5) ClosePricet=Stock Data [ldquoClosing Pricerdquo](6) Pt =ClosePricet lowast(1-clowastabs(TSt-TSt-1)) - slowastabs(TSt-TSt-1)(7) Pt-1 =ClosePricetlowast(1+clowastabs(TSt-TSt-1)) + slowastabs(TSt-TSt-1)(8) Rett= (Pt- Pt-1) Pt Ret is the return rate series(9) TDRR=lag (TS)lowastRet TDRR is the daily return through trading(10) WR[i]=sum (TDRRgt0)sum(TDRR =0)(11) ARR[i]=Returnannualized (TDRR)(12) ASR[i]=SharpeRatioannualized (TDRR)(13) MDD[i]=maxDrawDown (TDRR)(14) WR=c (WR WR[i])(15) ARR=c (ARR ARR[i])(16) ASR=c (ASR ASR[i])(17) MDD=c (MDD MDD[i])(18) (19) return (WR ARR ASR MDD)

Algorithm 3 Backtesting algorithm with transaction cost in R language

62 Analysis of Impact of Transaction Cost on the TradingPerformance of SPICS Transaction cost is one of the mostimportant factors affecting trading performance In US stocktrading transparent transaction cost can be charged accord-ing to a fixed fee per order or month or a floating fee basedon the volume and turnover of each transaction Sometimescustomers can also negotiate with broker to determinetransaction cost The transaction cost charged by differentbrokers varies greatly Meanwhile implicit transaction costis not known beforehand and the estimations of them arevery complex Therefore we assume that the percentageof turnover is the transparent transaction cost for ease ofcalculation In the aspect of implicit transaction cost we onlyconsider the impact of slippage on trading performance

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 24 WR is decreasing with the increase oftransaction cost for any trading algorithm which is intuitiveWhen the transaction cost is set to (s c) = (004 0005) theWR of each algorithm is the lowest Compared with setting(s c) = (0 0) the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR and SVM to XGB are reduced by580 597 591 1583 1804 1395 2171 16042216 1854 1850 and 2597 respectively ThereforeMLP DBN and SAE are more tolerant to transaction costGenerally speaking the DNN models have stronger capacityto accommodate transaction cost than the traditional MLmodels From the single trading algorithm such as MLP ifwe do not consider slippage ie s=0 the average WR ofMLP is 05510 under transaction cost structures (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not considertransparent transaction cost ie c=0 the averageWRofMLP

is 05618 under transaction cost structures (s1 c0) (s2 c0)(s3 c0) (s4 c0) so transparent transaction cost has greaterimpact than slippageThroughmultiple comparative analysisthe WR under the transaction cost structure (s1 c0) is notsignificantly different from the WR without transaction costfor MLP DBN and SAETheWR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the WR under the transaction cost structure (s1 c0) (s2 c0) are not significantly different from theWRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 25 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the lowest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 4031 4157 and 4093 respectivelywhile the ARR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin accounts For a general setting of s and c ie (s c) = (0020003) ARR of MLP DBN and SAE decrease by 23262400 and 2361 respectively while the ARR of otheralgorithms decrease by more than 50 and that of CARTand XGB decrease bymore than 100ThereforeMLP DBNand SAE are more tolerant to high transaction cost Fromsingle trading algorithm such as RNN if we do not considerslippage ie s=0 the average ARR of RNN is 01434 under

Mathematical Problems in Engineering 19

Table24Th

eWRof

SPICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

05676

05680

05683

05843

05825

05844

05266

05930

05912

05859

05831

05891

(s0c1)

05615

05618

05621

05669

05626

05694

05052

05752

05663

05654

05630

05599

(s0c2)

05560

05560

05564

05507

05442

05553

04847

05585

05429

05463

05438

05324

(s0c3)

05507

05506

05510

05353

05269

05418

04652

05424

05205

05278

05253

05061

(s0c4)

05457

05454

05460

05206

05101

05289

044

7005277

04996

05105

05084

04818

(s0c5)

05410

05407

05412

05071

04946

05170

04303

05138

04803

04947

04924

04594

(s1c0)

056

49056

53056

5605778

05751

05785

05190

058

61058

2405782

05759

05788

(s1c1)

05594

05597

05600

05619

05571

05648

04991

05700

05597

05595

05574

05521

(s1c2)

05539

05539

05544

05458

05389

05508

04788

05534

05364

05406

05383

05249

(s1c3)

05487

05486

05491

05305

05215

05375

04597

05375

05141

05223

05200

04988

(s1c4)

05438

05436

05441

05163

05052

05249

044

1805231

04938

05054

05034

04750

(s1c5)

05394

05390

05396

05032

04902

05132

04255

05097

04751

04900

04880

04532

(s2c0)

05628

05631

05635

05729

056

9705741

05134

058

1105758

05726

05704

05713

(s2c1)

05573

05574

05578

05568

05515

05602

04931

05647

05527

05535

05515

05442

(s2c2)

05518

05518

05523

05408

05336

05463

04729

05482

05297

05349

05326

05172

(s2c3)

05469

05467

05472

05260

05164

05334

04543

05330

05082

05171

05150

04918

(s2c4)

05421

05417

05423

05120

05004

05209

04368

05187

04881

05004

04986

046

85(s2c5)

05377

05373

05379

04993

04858

05096

04209

05055

04699

04855

04835

044

73(s3c0)

05606

05609

05612

05678

05640

05694

05074

05759

05690

05668

05646

05635

(s3c1)

05552

05553

05558

05518

05460

05556

04872

05595

05460

05478

05459

05365

(s3c2)

05499

05498

05503

05362

05284

05422

046

7505434

05233

05295

05273

05099

(s3c3)

05450

05448

05453

05216

05114

05292

04491

05284

05020

05120

05098

04849

(s3c4)

05405

05401

05407

05080

04960

05172

04321

05146

04827

04959

04940

04622

(s3c5)

05362

05357

05363

04955

04816

05063

04166

05017

04651

04815

04793

044

17(s4c0)

05587

05589

05593

05630

05588

05652

05019

05710

05627

05613

05593

05562

(s4c1)

05533

05533

05537

05470

05407

05513

04815

05544

05395

05424

05404

05290

(s4c2)

05480

05479

05484

05316

05232

05380

04620

05386

05171

05242

05220

05026

(s4c3)

05432

05429

05435

05172

05067

05253

044

4005241

04964

05070

05051

04782

(s4c4)

05388

05384

05391

05041

04917

05137

04274

05106

04775

04914

04897

04564

(s4c5)

05347

05341

05347

04918

04774

05029

04123

04979

046

0204773

04752

04361

20 Mathematical Problems in Engineering

Table25Th

eARR

ofSP

ICSford

ailytradingwith

different

transactioncost

Ther

esultthatthere

isno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

03332

03296

03325

02943

02920

02934

03317

02975

03133

02942

03067

03041

(s0c1)

03128

030

8703118

02439

02327

02521

02266

02496

02384

02336

02400

02137

(s0c2)

02924

02879

02912

01936

01735

02108

01216

02017

01636

01731

01734

01234

(s0c3)

02721

02672

02706

01433

0114

301697

00168

01539

00889

01126

01070

00333

(s0c4)

02519

02464

02500

00931

00553

01285

-00878

01062

00143

00522

004

06-00567

(s0c5)

02316

02257

02294

00430

-00037

00875

-019

2400586

-00602

-0008

-00257

-014

66(s1c0)

03249

03212

03242

027

7802729

02794

029

53028

18028

9802747

028

5502762

(s1c1)

03046

03004

03035

02274

02136

02381

01902

02339

02149

02141

02188

01859

(s1c2)

02842

02796

02829

01771

01544

01969

00853

01861

01401

01536

01523

00957

(s1c3)

02639

02588

02623

01269

00953

01557

-00195

01383

00654

00931

00858

000

56(s1c4)

02437

02381

02417

00767

00363

0114

6-012

41009

06-00091

00328

00195

-00844

(s1c5)

02234

02174

02211

00266

-00226

00735

-02285

00430

-00836

-00275

-0046

8-01742

(s2c0)

03167

03129

03159

026

1302538

026

54025

89026

61026

6302551

026

43024

84(s2c1)

02964

02921

02952

02110

01946

02241

01539

02182

01914

01946

01977

01581

(s2c2)

0276

02713

02746

01607

01354

01829

00490

01704

0116

701341

01312

006

79(s2c3)

02557

02505

02540

0110

400763

01418

-00557

01227

004

2000737

006

47-00221

(s2c4)

02355

02298

02334

006

0300173

01007

-016

0300750

-00325

00134

-00016

-01120

(s2c5)

02153

02091

02129

00102

-00416

00597

-0264

700274

-010

69-00469

-00678

-02018

(s3c0)

030

85030

46030

7602448

02348

02514

02225

02504

02428

02356

02431

02206

(s3c1)

02881

02838

02869

01945

01756

02102

0117

502026

01680

01751

01765

01304

(s3c2)

02678

02630

02663

01442

01164

01690

00127

01548

00933

0114

601100

004

02(s3c3)

02476

02422

02457

00940

00574

01279

-00919

01071

00187

00543

00436

-00498

(s3c4)

02273

02215

02252

00439

-00016

00868

-019

6400595

-00558

-0006

-00227

-013

97(s3c5)

02071

02008

02047

-00062

-0060

5004

58-0300

800119

-013

02-00662

-00889

-02294

(s4c0)

03003

02962

02993

02284

02157

02374

01862

02348

02193

02161

02219

01929

(s4c1)

02799

02754

02786

01781

01565

01962

00813

01870

01445

01556

01554

01026

(s4c2)

02597

02547

02580

01278

00974

01551

-00235

01392

00699

00952

00889

00125

(s4c3)

02394

02339

02375

00776

00384

0114

0-012

8100915

-0004

700349

00226

-00774

(s4c4)

02192

02132

02169

00275

-00205

00729

-02326

00439

-00792

-00254

-00437

-016

73(s4c5)

01989

01926

01964

-00225

-00794

00319

-033

69-00037

-015

35-00856

-010

99-02570

Mathematical Problems in Engineering 21

the transaction cost structures (s0 c1) (s0 c2) (s0 c3) (s0c4) (s0 c5) if we do not consider transparent transactioncost ie c=0 the average ARR of RNN is 02531 under thetransaction cost structure (s1 c0) (s2 c0) (s3 c0) (s4c0) so transparent transaction cost has greater impact thanslippage Through multiple comparative analysis the ARRunder the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s0 c1) are not significantly different from the ARRwithout transaction cost for MLP DBN and SAE the ARRunder all other transaction cost structures are significantlysmaller than theARRwithout transaction cost For all tradingalgorithms except for MLP DBN and SAE the ARR underthe transaction cost structures (s1 c0) (s2 c0) are notsignificantly different from the ARR without transactioncost the ARR under all other transaction cost structures aresignificantly smaller than the ARR without transaction cost

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 26 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theASR of each algorithm is the lowest Compared with settingwithout transaction cost the ASR of MLP DBN and SAEreduce by 3997 4123 and 4066 respectively while theASR of other trading algorithms reduce by more than 90compared with the case of no transaction cost Thereforeexcessive transaction cost will significantly reduce ASR Fora general setting of s and c ie (s c) = (002 0003) theASR of MLP DBN and SAE decrease by 2262 2336and 2302 respectively while the ASR of other algorithmsdecrease by more than 50 the ASR of CART and XGBdecrease by more than 100Therefore MLP DBN and SAEare more tolerant to transaction cost From single tradingalgorithm such as NB if we do not consider slippage ies=0 the average ASR of NB is 08052 under the transactioncost structure (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5)if we do not consider transparent transaction cost ie c=0the average ASR of NB is 14182 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has greater impact than slippage Throughmultiple comparative analysis the ASR under the transactioncost structures (s1 c0) (s2 c0) (s3 c0) (s0 c1) are notsignificantly different from the ASR without transaction costfor MLP DBN and SAE the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the ASR under the transaction cost structures(s1 c0) (s2 c0) are not significantly different from the ASRwithout transaction cost the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 27 MDD increases with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the settings without transaction cost theMDD of MLP DBN and SAE increase by 932 1108 and

1032 respectively The MDD of other trading algorithmsincrease by more than 80 compared with those withoutconsidering transaction costTherefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 483 580 and 533respectively while the MDD of other algorithms increase bymore than 35 and theMDDofCART RF andXGB increasebymore than 100Therefore MLP DBN and SAE are moretolerant to transaction cost As awhole theDNNmodels havestronger capacity to accommodate transaction cost than thetraditional ML models From single trading algorithm suchas GRU if we do not consider slippage ie s=0 the averageMDD of GRU is 04459 under the transaction cost structures(s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do notconsider transparent transaction cost ie c=0 the averageMDD of GRU is 03559 under the transaction cost structures(s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparent transactioncost has greater impact than slippage Through multiplecomparative analysis the MDD under any the transactioncost structure is not significantly different from the MDDwithout transaction cost for MLP DBN and SAE For alltrading algorithms except for MLP DBN and SAE such asLR the MDD under the transaction cost structures (s0 c1)(s1 c0) (s2 c0) (s3 c0) are not significantly different fromthe MDD without transaction cost the MDD under all othertransaction cost structures are significantly greater than theMDD without transaction cost

Through the analysis of the Table 27 performance eval-uation indicators we find that trading performance afterconsidering transaction cost will be worse than that withoutconsidering transaction cost as is in actual trading situationIt is noteworthy that the performance changes of DNNalgorithms especially MLP DBN and SAE are very smallafter considering transaction cost This shows that the threealgorithms have good tolerance to changes of transactioncost Especially for the MDD of the three algorithms thereis no significant difference with that with no transactioncost So we can consider applying them in actual tradingMeanwhile we conclude that the transparent transactioncost has greater impact on the trading performances thanthe slippage for SPICS This is because the prices of SPICSare too high when the transparent transaction cost is setto a certain percentage of turnover In actual transactionsspecial attention needs to be paid to the fact that the trans-action performance under most transaction cost structuresis significantly lower than the trading performance withoutconsidering transaction cost It is worth noting that theperformance of traditional ML algorithm is not worse thanthat ofDNNalgorithmswithout considering transaction costwhile the performance of DNN algorithms is better than thatof traditional ML algorithms after considering transactioncost

63 Analysis of Impact of Transaction Cost on the TradingPerformance of CSICS Similar to Section 62 we will discussthe impact of transaction cost on trading performance ofCSICS in the followings In the Chinese A-share marketthe transparent transaction cost is usually set to a certain

22 Mathematical Problems in Engineering

Table26Th

eASR

ofSP

ICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

1546

815

412

15502

15764

15571

15828

13927

16237

16763

15818

16018

16298

(s0c1)

1456

214

478

14577

1300

012

317

13565

09346

13554

12650

12472

12456

11294

(s0c2)

13639

13527

13635

10191

09015

11262

04657

10822

08482

09074

08846

06236

(s0c3)

12702

12561

12679

07355

05690

08929

-00085

08061

04298

05652

05216

0118

2(s0c4)

11751

11581

11709

04511

02366

06580

-04823

05291

00139

02234

01596

-03812

(s0c5)

1079

10591

10728

01678

-00931

04227

-09500

02534

-039

59-01152

-019

87-08696

(s1c0)

15121

1505

715

149

1492

714

606

15119

1244

915

424

1558

214

825

14974

1488

6(s1c1)

14208

14116

14217

12146

11334

12841

07823

12722

1144

711459

11394

09859

(s1c2)

13279

13159

13270

09325

08020

10526

03105

09977

07267

08048

07772

04792

(s1c3)

12337

12188

12308

064

8204690

08185

-016

4607209

03082

04622

04139

-00257

(s1c4)

11382

11204

11333

03637

01368

05831

-06374

04438

-010

6801208

00524

-052

31(s1c5)

10417

10210

10348

00807

-019

2003478

-110

2501686

-05146

-02169

-0304

7-10083

(s2c0)

1477

1469

914

792

1408

113

632

1440

310

946

1460

114

390

1382

213

922

1346

2(s2c1)

13851

13752

13854

11285

10343

12111

06283

11883

10237

10439

10325

08416

(s2c2)

12916

12789

12901

08454

07021

09785

01547

09128

060

4907019

06696

03346

(s2c3)

11969

11812

11934

05607

03688

07437

-032

0506355

01868

03591

03063

-016

90(s2c4)

11010

10825

10955

02763

00372

05081

-07916

03586

-02268

00183

-00545

-06639

(s2c5)

1004

109827

09967

-0006

-02905

02729

-12533

00841

-06323

-031

79-04101

-114

54(s3c0)

14415

14337

14432

13227

12650

13679

09425

13770

13189

12810

12862

12030

(s3c1)

13490

13384

13488

10419

09348

11375

04733

11039

09023

09413

09252

06971

(s3c2)

12551

12416

12529

07580

060

19090

40-00013

08275

04832

05988

05618

01904

(s3c3)

11599

11435

11558

04731

02688

066

88-04757

05500

00658

02562

01988

-031

16(s3c4)

10636

10443

10575

01891

-00620

04331

-0944

202735

-0346

0-00836

-016

08-08034

(s3c5)

09664

09443

09584

-00924

-03883

01982

-14018

000

00-074

89-04183

-05146

-12808

(s4c0)

14058

13972

1406

812

368

11662

12950

07892

12933

11983

11793

11796

10591

(s4c1)

13127

13013

13119

09549

08350

10634

03180

10190

07807

08386

08177

05527

(s4c2)

12183

1204

12155

06705

05018

08293

-015

6807421

03617

04958

04542

004

68(s4c3)

11226

11055

11179

03857

01691

05938

-06295

046

47-00545

01537

00918

-04529

(s4c4)

1026

1006

10193

01021

-016

0703582

-10948

01888

-0464

2-018

49-02665

-09413

(s4c5)

09286

09057

09199

-017

83-04853

01238

-15478

-00836

-0864

2-05177

-06182

-14142

Mathematical Problems in Engineering 23

Table 27 The MDD of SPICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 03583 03584 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338(s0 c1) 03629 03638 03594 03779 03986 03636 04072 03712 03843 03963 03972 04203(s0 c2) 03677 03695 03647 04302 04707 03968 05168 04127 04842 04729 04787 05735(s0 c3) 03727 03756 03703 04990 05639 04376 06564 04709 06172 05682 05844 07335(s0 c4) 03781 03821 03764 05767 06612 04873 07804 05424 07377 06653 06913 08447(s0 c5) 03839 03890 03828 06529 0746 05444 08730 06162 08272 07501 07808 09118(s1 c0) 03596 03600 03560 03500 036130 03446 03574 03502 03414 03585 03569 03540(s1 c1) 03642 03655 03609 03907 04156 03717 04320 03814 04067 04154 04170 04541(s1 c2) 03691 03712 03662 04466 04936 04066 05534 04270 05172 04971 05049 06168(s1 c3) 03742 03774 03720 05183 05895 04495 06928 04885 06499 05937 06129 07662(s1 c4) 03796 03839 03781 05961 06842 05013 08105 05610 07631 06884 07161 08649(s1 c5) 03856 03909 03847 0671 07646 05595 08946 06342 08451 07691 0800 09235(s2 c0) 03609 03615 03573 03607 03756 03517 03770 03586 03586 03739 03727 03787(s2 c1) 03656 03671 03623 04047 04349 03805 04627 03929 04339 04365 04397 04929(s2 c2) 03705 03729 03678 04642 05176 04171 05916 04424 05504 05218 05327 06577(s2 c3) 03756 03792 03736 05377 06143 04624 07277 05067 06805 06183 06402 07939(s2 c4) 03812 03859 03799 06155 07056 05161 08380 05796 07856 07099 07388 08816(s2 c5) 03873 03930 03866 06887 07816 05751 09126 06517 08606 07864 08172 09331(s3 c0) 03622 03631 03588 03729 03912 03594 04004 03685 03795 03909 03909 04081(s3 c1) 03669 03687 03639 04200 04555 03901 04966 04062 04622 04587 04642 05334(s3 c2) 03719 03746 03694 04826 05423 04286 06295 04589 05833 05465 05607 06936(s3 c3) 03772 03811 03754 05572 06377 04762 07609 05248 07081 06420 06657 08175(s3 c4) 03829 03879 03818 06341 07254 05314 08620 05980 08054 07300 07593 08956(s3 c5) 03894 03954 03888 07056 07972 05909 09275 06689 08740 08022 08325 09412(s4 c0) 03635 03647 03602 03861 04082 03678 04274 03798 04015 04096 04114 04396(s4 c1) 03683 03704 03654 04362 04774 04005 05325 04211 04908 04814 04894 05730(s4 c2) 03734 03765 03712 05013 05664 04410 06667 04758 06142 05707 05875 07253(s4 c3) 03790 03833 03775 05765 06600 04905 07906 05429 07330 06644 06894 08375(s4 c4) 03851 03904 03841 06521 07439 05470 08824 06162 08230 07485 07782 09074(s4 c5) 03917 03981 03913 07218 08115 06067 09395 06857 08858 08165 08463 09480

percentage of turnover and it is the same as the assumptionin the experimental settings As in the US stock market thesmallest unit of price change is 001 (one tick) It is reasonableto set slippage to be 001-005 Of course it should be notedthat the prices fluctuation may be more intense when closingthan that in the middle of a trading day

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 28 the WR is decreasing with the increaseof transaction cost for any trading algorithm When thetransaction cost is set to (s c) = (004 0005) the WR of eachalgorithm is the smallest Comparedwith the settings withouttransaction cost the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR SVM and XGB are reduced by671 688 697 2269 1726 1548 2430 14912484 2112 2112 and 2919 respectively For a generalsetting of s and c ie (s c) = (002 0003) the WR ofMLP DBN and SAE decrease by 410 420 and 430respectively while the WR of other algorithms decrease bymore than 9 the WR of CART RF and XGB decrease by

more than 15 Therefore MLP DBN and SAE are moretolerant to transaction cost From single trading algorithmsuch as LSTM if we do not consider slippage ie s=0 theaverage WR of DBN is 05417 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage WR of LSTM is 05304 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the WR under the transactioncost structures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the WR without transaction cost for MLPDBN SAE and NB the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN SAE and NB the WR under the transaction coststructure (s0 c1) is not significantly different from the WRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

24 Mathematical Problems in Engineering

Table 28 The WR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803(s0 c1) 05523 05527 05525 05525 05608 05620 05009 05227 05612 05665 05571 05595(s0 c2) 05488 05492 05489 05389 05512 05535 04879 05149 05460 05542 05445 05411(s0 c3) 05453 05456 05452 05258 05414 05451 04747 05068 05313 05418 05320 05234(s0 c4) 05417 05419 05414 05127 05320 05368 04622 04991 05172 05297 05202 05067(s0 c5) 05383 05383 05379 05004 05230 05286 04504 04917 05036 05180 05088 04905(s1 c0) 05494 05499 05497 05444 05541 05558 04925 05170 05520 05584 05492 05488(s1 c1) 05456 05459 05456 05286 05424 05456 04775 05080 05342 05437 05345 05275(s1 c2) 05421 05423 05420 05161 05335 05377 04654 05007 05207 05320 05231 05110(s1 c3) 05386 05388 05383 05036 05246 05296 04530 04931 05065 05205 05116 04946(s1 c4) 05353 05354 05349 04915 05156 05218 04419 04861 04937 05095 05007 04795(s1 c5) 05323 05323 05317 04808 05076 05148 04315 04796 04817 04995 04905 04652(s2 c0) 05431 05434 05431 05219 05368 05403 04707 05036 05269 05374 05286 05189(s2 c1) 05395 05397 05393 05078 05266 05314 04573 04956 05115 05242 05154 05005(s2 c2) 05360 05361 05357 04960 05181 05237 04458 04886 04985 05134 05046 04853(s2 c3) 05331 05331 05326 04850 05100 05167 04352 04818 04864 05031 04945 04711(s2 c4) 05300 05300 05293 04743 05018 05093 04252 04752 04746 04931 04846 04572(s2 c5) 05273 05271 05266 04648 04946 05029 04159 04692 04639 04838 04755 04445(s3 c0) 05373 05374 05371 05019 05216 05265 04514 04917 05049 05186 05098 04932(s3 c1) 05341 05341 05336 04902 05128 05188 04399 04846 04917 05074 04990 04775(s3 c2) 05312 05312 05306 04798 05052 05122 04303 04782 04804 04977 04896 04644(s3 c3) 05281 05281 05275 04696 04976 05049 04206 04718 04689 04879 04799 04509(s3 c4) 05252 05251 05245 04598 04901 04984 04110 04657 04581 04785 04707 04378(s3 c5) 05226 05223 05218 04510 04833 04924 04023 04602 04481 04701 04621 04264(s4 c0) 05325 05325 05321 04860 05089 05150 04360 04816 04870 05030 04949 04723(s4 c1) 05294 05294 05289 04753 05010 05079 04258 04750 04752 04928 04849 04588(s4 c2) 05266 05265 05259 04653 04937 05013 04164 04690 04642 04838 04761 04458(s4 c3) 05238 05236 05230 04562 04864 04948 04073 04632 04541 04747 04672 04336(s4 c4) 05211 05208 05203 04475 04798 04891 03985 04577 04440 04662 04586 04218(s4 c5) 05186 05182 05176 04392 04733 04832 03901 04524 04348 04582 04509 04109

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 29 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the smallest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 5073 5175 and 5225 respectivelyWhile the ARR of other trading algorithms decrease bymore than 100 compared with those algorithms withouttransaction cost Therefore excessive transaction cost canlead to serious losses in the accounts For a general settingof s and c ie (s c) = (002 0003) ARR of MLP DBNand SAE decrease by 2741 2797 and 2825 respectivelywhile the ARR other algorithms decrease by more than 50and that of CART NB RF and XGB decrease by more than100 Therefore MLP DBN and SAE are more tolerant totransaction cost From single trading algorithm such as SAEif we do not consider slippage ie s=0 the average ARR ofSAE is 05040 under the transaction cost structure (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not consider

transparent transaction cost ie c=0 the averageARRof SAEis 04468 under the transaction cost structures (s1 c0) (s2c0) (s3 c0) (s4 c0) so transparent transaction cost hassmaller impact than slippage Through multiple comparativeanalysis the ARR under the transaction cost structures (s0c1) (s0 c2) (s0 c3) (s0 c1) (s1 c1) are not significantlydifferent from the ARR without transaction cost for MLPDBN and SAE the ARR under all other transaction coststructures are significantly smaller than the ARR withouttransaction cost For RNN LSTM GRU CART RF LR andSVM the ARR under the transaction cost structures (s0c1) (s0 c2) (s1 c0) are not significantly different fromthe ARR without transaction cost the ARR under all othertransaction cost structures are significantly smaller than theARR without transaction cost For NB and XGB the ARRunder the transaction cost structures (s0 c1) (s1 c0) arenot significantly different from the ARR without transactioncost the ARR under all other transaction cost structuresare significantly smaller than the ARR without transactioncost

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 13: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

Mathematical Problems in Engineering 13

Table 15Multiple comparison analysis between theARof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 01857GRU 00000 00000 00000 04439 10000CART 00000 00000 00000 09765 00024 00131NB 00000 00001 00002 00022 00000 00000 01810RF 00000 00002 00005 00007 00000 00000 00941 10000LR 00000 00000 00000 00076 00000 00000 03454 10000 10000SVM 00217 00766 01309 00000 00000 00000 00003 08314 09352 06360XGB 00000 00001 00001 00025 00000 00000 01930 10000 10000 10000 08168

Table 16Multiple comparison analysis between the PRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 09906 09781NB 00000 00000 00000 00000 01716 01234 08940RF 00000 00000 00000 00000 00319 00205 05271 10000LR 00000 00000 00000 00000 10000 10000 09951 02099 00422SVM 00000 00000 00000 01157 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00000 09922 09811 10000 08836 05086 09960 00000

highest in all trading strategies The MDD of CSI 300 index(benchmark index) is the smallest in all trading strategiesTheWRARR and ASR of all ML algorithms are greater thanthose of the benchmark index and BAH strategy

(1) Through the hypothesis test analysis of H1a and H1bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the AR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 15The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 15 we can see that the AR ofMLPDBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms except for SVM The ARof GRU is significantly smaller than that of all traditional MLalgorithms There is no significant difference between the ARof any two traditional ML algorithms except for CART andSVM

(2) Through the hypothesis test analysis of H2a and H2bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the PR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 16 The number in the tableis a p value of any two algorithms of Nemenyi test FromTables 14 and 16 we can see that the PR of MLP DBN and

SAE are significantly greater than that of all other tradingalgorithms and the PR of MLP DBN and SAE have nosignificant difference The PR of SVM is significantly greaterthan that of all other traditional ML algorithms which haveno significant difference between any two algorithms exceptfor SVM The PR of RNN is significantly greater than thatof all traditional ML algorithms except for SVM The PR ofGRU and LSTM are not significantly different from that of alltraditional ML algorithms except for SVM and LR

(3) Through the hypothesis test analysis of H3a and H3bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the RR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 17 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 17 we can see that the RR of all DNN models arenot significantly different There is no significant differenceamong the RR of all traditional ML algorithms The RR ofRNN GRU and LSTM are significantly smaller than that ofany traditional ML algorithm except for CART

(4) Through the hypothesis test analysis of H4a and H4bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the F1 of all trading algorithms There-fore we need to do further multiple comparative analysis and

14 Mathematical Problems in Engineering

Table 17Multiple comparison analysis between the RRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 09996 09996 10000LSTM 09309 09314 09781 09999GRU 09660 09663 09916 10000 10000CART 09744 09742 09225 05809 01509 02138NB 01093 01088 00574 00075 00004 00007 08861RF 00537 00534 00260 00028 00001 00002 07544 10000LR 00330 00328 00152 00015 00001 00001 06498 10000 10000SVM 03444 03434 02170 00434 00033 00059 09920 10000 09998 09991XGB 00193 00192 00085 00007 00000 00000 05344 10000 10000 10000 09960

Table 18 Multiple comparison analysis between the F1 of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 07211 06670NB 00000 00000 00000 00136 00132 00099 08664RF 00000 00000 00000 00786 00016 00011 05162 10000LR 00000 00000 00000 00000 09440 09208 10000 05675 02181SVM 00000 00000 00000 00178 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00001 03138 02679 10000 09937 08849 09964 00000

Table 19 Multiple comparison analysis between the AUC of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 09999 10000RNN 09945 09985 10000LSTM 05273 06382 09259 09937GRU 08448 09102 09958 10000 10000CART 06921 05835 02356 00801 00014 00096NB 00002 00001 00000 00000 00000 00000 02616RF 00001 00001 00000 00000 00000 00000 02002 10000LR 00000 00000 00000 00000 00000 00000 00930 10000 10000SVM 00027 00014 00001 00000 00000 00000 06454 10000 09999 09980XGB 00000 00000 00000 00000 00000 00000 01257 10000 10000 10000 09993

the results are shown in Table 18The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 18 we can see that the F1 of MLP DBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms There is no significantdifference among traditionalML algorithms except SVM andthe F1 of SVM is significantly greater than that of all othertraditional ML algorithms

(5) Through the hypothesis test analysis of H5a and H5bwe can obtain p valuelt22e-16Therefore there are significantdifferences between theAUCof all trading algorithmsThere-fore we need to do further multiple comparative analysis andthe results are shown in Table 19 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 19 we can see that the AUC of all DNN models haveno significant difference There is no significant difference

Mathematical Problems in Engineering 15

Table 20 Multiple comparison analysis between the WR of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 04117MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00002 00006 00000LSTM 00000 00000 00000 00000 00000 09772GRU 00000 00000 00000 00000 00000 09911 10000CART 09931 00000 00000 00000 00000 00000 00000 00000NB 00031 00000 00001 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00205 06437 05358 00000 00000LR 00000 00000 00000 00000 00000 00010 01611 01105 00000 00000 10000SVM 00000 00000 00000 00000 00000 09914 10000 10000 00000 00000 05322 01090XGB 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000

Table 21Multiple comparison analysis between theARRof any two trading strategiesThepvalue of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00007MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 04790 06355 07182LSTM 00000 00000 02512 03806 04630 10000GRU 00000 00000 02235 03454 04249 10000 10000CART 00000 00000 08301 09217 09542 10000 09999 09998NB 00000 00000 10000 10000 10000 02920 01295 01125 06517RF 00000 00000 00020 00048 00076 08705 09735 09806 05393 00006LR 00000 00000 02058 03222 03995 10000 10000 10000 09996 01019 09845SVM 00000 00000 10000 00803 01114 09993 10000 10000 09659 00165 09999 10000XGB 00000 00000 10000 00333 00484 09916 09997 09998 08789 00057 10000 09999 10000

between the AUC of all traditional ML algorithms TheAUC of all traditional ML algorithms except for CART aresignificantly greater than that of any DNN model There isno significant difference among the AUC ofMLP SAE DBNRNN and CART

(6)Through the hypothesis test analysis of H6a and H6bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the WR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 20 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 20 we can see that the WR of BAH and benchmarkindex have no significant difference but they are significantlysmaller than that of anyML algorithmTheWRofMLPDBNand SAE are significantly smaller than that of the other trad-ing algorithms but there is no significant difference betweenthe WR of MLP DBN and SAE The WR of LSTM andGRU have no significant difference but they are significantlysmaller than that of XGB and significantly greater than that of

CART and NB In traditional MLmodels the WR of NB andCART are significantly smaller than that of other algorithmsThe WR of XGB is significantly greater than that of all otherML algorithms

(7)Through the analysis of the hypothesis test of H7a andH7b we obtain p valuelt22e-16

Therefore there are significant differences between theARR of all trading strategies including the benchmark indexand BAH strategy Therefore we need to do further multiplecomparative analysis and the results are shown in Table 21FromTables 14 and 21 we can see that ARR of the benchmarkindex and BAH are significantly smaller than that of alltrading algorithms The ARR of MLP is significantly higherthan that of RF but there is no significant difference betweenMLP and other algorithms The ARR of SAE and DBN aresignificantly higher than that of RF and XGB but they arenot significantly different fromARR of other algorithms TheARR of NB is significantly higher than that of RF SVMand XGB But otherwise there is no significant difference

16 Mathematical Problems in Engineering

Table 22Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 08877MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 09099 08862 08114LSTM 00000 00000 03460 03080 02239 09999GRU 00000 00000 02132 01853 01270 09981 10000CART 00000 00000 00158 00195 00327 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000 00000 07298RF 00000 00000 10000 10000 10000 09968 07444 05789 00018 00000LR 00000 00000 01181 01003 00650 09879 10000 10000 00000 00000 04044SVM 00000 00000 10000 10000 10000 09849 05952 04238 00042 00000 10000 02704XGB 00000 00000 09937 09902 09746 10000 09878 09532 00001 00000 10000 08723 09998

Table 23 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00006DBN 00000 00004 10000SAE 00000 00023 10000 10000RNN 00000 00000 00320 00421 00111LSTM 00000 00000 00002 00003 00000 09947GRU 00000 00000 00001 00001 00000 09767 10000CART 00000 00000 01238 01538 00521 10000 09241 08305NB 00000 01875 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 01180 01469 00493 10000 09298 08401 10000 00000LR 00000 00000 00001 00002 00000 09881 10000 10000 08821 00000 08898SVM 00000 00000 03285 03839 01701 09999 07011 05424 10000 00000 10000 06216XGB 00000 00000 00308 00405 00106 10000 09951 09783 10000 00000 10000 09890 09998

between any other two algorithms Therefore the ARR ofmost traditional ML models are not significantly worse thanthat of the best DNNmodel

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore There are significantdifferences betweenASRof all trading strategies including thebenchmark index and BAH strategy The results of multiplecomparative analysis are shown in Table 22 From Tables 14and 22 we can see that the ASR of the benchmark indexand BAH are significantly smaller than that of all tradingalgorithms The ASR of all ML algorithms are significantlyhigher than that of CART and NB but there is no significantdifference between the ASR of CART and NB Beyond thatthere is no significant difference between any other twoalgorithms Therefore the ASR of all traditional ML modelsexcept NB and CART are not significantly worse than that ofany DNNmodel

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between the MDD of these trading strategies

including the benchmark index and the BAH strategyThe results of multiple comparative analysis are shown inTable 23 From Tables 14 and 23 we can see that the MDDof the benchmark index is significantly smaller than that ofother trading strategies including BAH strategy TheMDD ofBAH is significantly greater than that of all trading algorithmsexcept NBTheMDDofMLPDBN and SAE are significantlylower than that of NB but significantly higher than thatof RNN LSTM GRU LR and XGB The MDD of NB issignificantly greater than that of all other trading algorithmsBeyond that there is no significant difference between anyother two algorithms Therefore all ML algorithms expectNB especially LSTM RNN GRU LR and XGB can play arole in controlling trading risk

In a word some DNN models such as MLP DBN andSAE have good performance in AR PR and F1 traditionalML algorithms such as LR and XGB have good performanceinAUCandWRTheARRof some traditionalML algorithmssuch as CART NB LR and SVM are not significantlydifferent from that of the six DNN models The ASR of the

Mathematical Problems in Engineering 17

six DNN algorithms are not significantly different from alltraditional ML models except NB and CART The MDD ofLR and XGB are significantly smaller than those of MLPDBN and SAE and are not significantly different fromthat of LSTM GRU and RNN The ARR and ASR of allML algorithms are significantly greater than those of BAHand benchmark index the MDD of all ML algorithms aresignificantly smaller than that of the benchmark index butsignificantly greater than that of BAH strategy

From the above analysis and evaluation we can see thatthe directional evaluation indicators of some DNN modelsare very competitive in CSICS while the indicators of sometraditional ML algorithms have excellent performance inSPICS Whether in SPICS or CSICS the ARR and ASR ofall ML algorithms are significantly greater than that of thebenchmark index and BAH strategy respectively In all MLalgorithms there are always some traditional ML algorithmswhich are not significantly worse than the best DNN modelfor any performance evaluation indicator (ARR ASR andMDD)Therefore if we do not consider transaction cost andother factors affecting trading performance of DNN modelsare alternative but not the best choice when they are appliedto stock trading

In the same period the ARR of any ML algorithm inCSICS is significantly greater than that of the same algorithmin SPICS (p valuelt0001 in theNemenyi test)Meanwhile theMDD of any ML algorithm in CSICS is significantly greaterthan that of the same algorithm in SPICS (p value lt0001in the Nemenyi test) The results show that the quantitativetrading algorithms can more easily obtain excess returns inthe Chinese A-share market but the volatility risk of tradingin Chinese A-share market is significantly higher than that ofthe US stock market in the past 8 years

6 The Impact of Transaction Cost onPerformance of ML Algorithms

Trading cost can affect the profitability of a stock tradingstrategy Transaction cost that can be ignored in long-termstrategies is significantly magnified in daily trading Howevermany algorithmic trading studies assume that transactioncost does not exist ([10 17] etc) In practice frictions suchas transaction cost can distort the market from the perfectmodel in textbooks The cost known prior to trading activityis referred to as transparent such as commissions exchangefees and taxes The costs that has to be estimated are knownas implicit including comprise bid-ask spread latency orslippage and related market impact This section focuses onthe transparent and implicit cost and how do they affecttrading performance in daily trading

61 Experimental Settings and Backtesting Algorithm In thispart the transparent transaction cost is calculated by a certainpercentage of transaction turnover for convenience theimplicit transaction cost is very complicated in calculationand it is necessary to make a reasonable estimate for therandom changes of market environment and stock pricesTherefore we only discuss the impact of slippage on tradingperformance

The transaction cost structures of American stocks aresimilar to that of Chinese A-shares We assume that transpar-ent transaction cost is calculated by a percentage of turnoversuch as less than 05 [40 41] and 02 and 05 in theliterature [42] It is different for the estimation of slippage

In some quantitative trading simulation software such asJoinQuant [43] and Abuquant [44] the slippage is set to 002The transparent transaction cost and implicit transaction costare charged in both directions when buying and selling Itis worth noting that the transparent transaction cost varieswith the different brokers while the implicit transaction costis related to market liquidity market information networkstatus trading software etc

We set slippages s = s0=0 s1=001 s2=002 s3=003s4=004 the transparent transaction cost c = c0=0 c1=0001c2=0002 c3=0003 c4=0004 c5=0005 For different s ccombinations we study the impact of different transactioncost structures on trading performance We assume thatbuying and selling positions are one unit so the turnover isthe corresponding stock price When buying stocks we notonly need to pay a certain percentage cost of the purchaseprice but also need to pay an uncertain slippage cost Thatis we need to pay a higher price than the real-time price119875119905minus1

when we are buying But when selling stocks we notonly need to pay a certain percentage cost of the sellingprice but also to pay an uncertain slippage cost Generallyspeaking we need to sell at a price lower than the real-timeprice 119875

119905 It is worth noting that our trading strategy is self-

financing If ML algorithms predict the continuous occur-rence of buying signals or selling signals ie |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 0 we will continue to hold or do nothingso the transaction cost at this time is 0 when |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 1 it is indicated that the position maybe changed from holding to selling or from empty positionto buying At this time we would pay transaction costdue to the trading operation Finally we get a real yieldis

119877119890119905119905le119862119897119900119904119890119875119903119894119888119890

119905minus 119862119897119900119904119890119875119903119894119888119890

119905minus1

119862119897119900119904119890119875119903119894119888119890119905minus1

119875119905= 119862119897119900119904119890119875119903119894119888119890

119905

lowast (1 minus 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816)

minus 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816

119875119905minus1

= 119862119897119900119904119890119875119903119894119888119890119905minus1

lowast (1 + 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816)

+ 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816

119877119890119905119905=119875119905minus 119875119905minus1

119875119905minus1

(5)

where 119862119897119900119904119890119875119903119894119888119890119905

denotes the 119905-th closing price119879119903119886119889119890119878119894119892119899119886119897

119905denotes the 119905-th trading signal 119875

119905denotes

the 119905-th executing price and 119877119890119905119905denotes the 119905-th return rate

We propose a backtesting algorithm with transaction costbased on the above analysis as is shown in Algorithm 3

18 Mathematical Problems in Engineering

Input TS TS is trading signals of a stocks s is slippagec c is transparent transaction cost

Output WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) WR=NULL ARR=NULL ASR=NULL MDD=NULL(3) for (i in 1 N) (4) Stock Data=Stock Code List[i](5) ClosePricet=Stock Data [ldquoClosing Pricerdquo](6) Pt =ClosePricet lowast(1-clowastabs(TSt-TSt-1)) - slowastabs(TSt-TSt-1)(7) Pt-1 =ClosePricetlowast(1+clowastabs(TSt-TSt-1)) + slowastabs(TSt-TSt-1)(8) Rett= (Pt- Pt-1) Pt Ret is the return rate series(9) TDRR=lag (TS)lowastRet TDRR is the daily return through trading(10) WR[i]=sum (TDRRgt0)sum(TDRR =0)(11) ARR[i]=Returnannualized (TDRR)(12) ASR[i]=SharpeRatioannualized (TDRR)(13) MDD[i]=maxDrawDown (TDRR)(14) WR=c (WR WR[i])(15) ARR=c (ARR ARR[i])(16) ASR=c (ASR ASR[i])(17) MDD=c (MDD MDD[i])(18) (19) return (WR ARR ASR MDD)

Algorithm 3 Backtesting algorithm with transaction cost in R language

62 Analysis of Impact of Transaction Cost on the TradingPerformance of SPICS Transaction cost is one of the mostimportant factors affecting trading performance In US stocktrading transparent transaction cost can be charged accord-ing to a fixed fee per order or month or a floating fee basedon the volume and turnover of each transaction Sometimescustomers can also negotiate with broker to determinetransaction cost The transaction cost charged by differentbrokers varies greatly Meanwhile implicit transaction costis not known beforehand and the estimations of them arevery complex Therefore we assume that the percentageof turnover is the transparent transaction cost for ease ofcalculation In the aspect of implicit transaction cost we onlyconsider the impact of slippage on trading performance

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 24 WR is decreasing with the increase oftransaction cost for any trading algorithm which is intuitiveWhen the transaction cost is set to (s c) = (004 0005) theWR of each algorithm is the lowest Compared with setting(s c) = (0 0) the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR and SVM to XGB are reduced by580 597 591 1583 1804 1395 2171 16042216 1854 1850 and 2597 respectively ThereforeMLP DBN and SAE are more tolerant to transaction costGenerally speaking the DNN models have stronger capacityto accommodate transaction cost than the traditional MLmodels From the single trading algorithm such as MLP ifwe do not consider slippage ie s=0 the average WR ofMLP is 05510 under transaction cost structures (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not considertransparent transaction cost ie c=0 the averageWRofMLP

is 05618 under transaction cost structures (s1 c0) (s2 c0)(s3 c0) (s4 c0) so transparent transaction cost has greaterimpact than slippageThroughmultiple comparative analysisthe WR under the transaction cost structure (s1 c0) is notsignificantly different from the WR without transaction costfor MLP DBN and SAETheWR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the WR under the transaction cost structure (s1 c0) (s2 c0) are not significantly different from theWRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 25 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the lowest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 4031 4157 and 4093 respectivelywhile the ARR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin accounts For a general setting of s and c ie (s c) = (0020003) ARR of MLP DBN and SAE decrease by 23262400 and 2361 respectively while the ARR of otheralgorithms decrease by more than 50 and that of CARTand XGB decrease bymore than 100ThereforeMLP DBNand SAE are more tolerant to high transaction cost Fromsingle trading algorithm such as RNN if we do not considerslippage ie s=0 the average ARR of RNN is 01434 under

Mathematical Problems in Engineering 19

Table24Th

eWRof

SPICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

05676

05680

05683

05843

05825

05844

05266

05930

05912

05859

05831

05891

(s0c1)

05615

05618

05621

05669

05626

05694

05052

05752

05663

05654

05630

05599

(s0c2)

05560

05560

05564

05507

05442

05553

04847

05585

05429

05463

05438

05324

(s0c3)

05507

05506

05510

05353

05269

05418

04652

05424

05205

05278

05253

05061

(s0c4)

05457

05454

05460

05206

05101

05289

044

7005277

04996

05105

05084

04818

(s0c5)

05410

05407

05412

05071

04946

05170

04303

05138

04803

04947

04924

04594

(s1c0)

056

49056

53056

5605778

05751

05785

05190

058

61058

2405782

05759

05788

(s1c1)

05594

05597

05600

05619

05571

05648

04991

05700

05597

05595

05574

05521

(s1c2)

05539

05539

05544

05458

05389

05508

04788

05534

05364

05406

05383

05249

(s1c3)

05487

05486

05491

05305

05215

05375

04597

05375

05141

05223

05200

04988

(s1c4)

05438

05436

05441

05163

05052

05249

044

1805231

04938

05054

05034

04750

(s1c5)

05394

05390

05396

05032

04902

05132

04255

05097

04751

04900

04880

04532

(s2c0)

05628

05631

05635

05729

056

9705741

05134

058

1105758

05726

05704

05713

(s2c1)

05573

05574

05578

05568

05515

05602

04931

05647

05527

05535

05515

05442

(s2c2)

05518

05518

05523

05408

05336

05463

04729

05482

05297

05349

05326

05172

(s2c3)

05469

05467

05472

05260

05164

05334

04543

05330

05082

05171

05150

04918

(s2c4)

05421

05417

05423

05120

05004

05209

04368

05187

04881

05004

04986

046

85(s2c5)

05377

05373

05379

04993

04858

05096

04209

05055

04699

04855

04835

044

73(s3c0)

05606

05609

05612

05678

05640

05694

05074

05759

05690

05668

05646

05635

(s3c1)

05552

05553

05558

05518

05460

05556

04872

05595

05460

05478

05459

05365

(s3c2)

05499

05498

05503

05362

05284

05422

046

7505434

05233

05295

05273

05099

(s3c3)

05450

05448

05453

05216

05114

05292

04491

05284

05020

05120

05098

04849

(s3c4)

05405

05401

05407

05080

04960

05172

04321

05146

04827

04959

04940

04622

(s3c5)

05362

05357

05363

04955

04816

05063

04166

05017

04651

04815

04793

044

17(s4c0)

05587

05589

05593

05630

05588

05652

05019

05710

05627

05613

05593

05562

(s4c1)

05533

05533

05537

05470

05407

05513

04815

05544

05395

05424

05404

05290

(s4c2)

05480

05479

05484

05316

05232

05380

04620

05386

05171

05242

05220

05026

(s4c3)

05432

05429

05435

05172

05067

05253

044

4005241

04964

05070

05051

04782

(s4c4)

05388

05384

05391

05041

04917

05137

04274

05106

04775

04914

04897

04564

(s4c5)

05347

05341

05347

04918

04774

05029

04123

04979

046

0204773

04752

04361

20 Mathematical Problems in Engineering

Table25Th

eARR

ofSP

ICSford

ailytradingwith

different

transactioncost

Ther

esultthatthere

isno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

03332

03296

03325

02943

02920

02934

03317

02975

03133

02942

03067

03041

(s0c1)

03128

030

8703118

02439

02327

02521

02266

02496

02384

02336

02400

02137

(s0c2)

02924

02879

02912

01936

01735

02108

01216

02017

01636

01731

01734

01234

(s0c3)

02721

02672

02706

01433

0114

301697

00168

01539

00889

01126

01070

00333

(s0c4)

02519

02464

02500

00931

00553

01285

-00878

01062

00143

00522

004

06-00567

(s0c5)

02316

02257

02294

00430

-00037

00875

-019

2400586

-00602

-0008

-00257

-014

66(s1c0)

03249

03212

03242

027

7802729

02794

029

53028

18028

9802747

028

5502762

(s1c1)

03046

03004

03035

02274

02136

02381

01902

02339

02149

02141

02188

01859

(s1c2)

02842

02796

02829

01771

01544

01969

00853

01861

01401

01536

01523

00957

(s1c3)

02639

02588

02623

01269

00953

01557

-00195

01383

00654

00931

00858

000

56(s1c4)

02437

02381

02417

00767

00363

0114

6-012

41009

06-00091

00328

00195

-00844

(s1c5)

02234

02174

02211

00266

-00226

00735

-02285

00430

-00836

-00275

-0046

8-01742

(s2c0)

03167

03129

03159

026

1302538

026

54025

89026

61026

6302551

026

43024

84(s2c1)

02964

02921

02952

02110

01946

02241

01539

02182

01914

01946

01977

01581

(s2c2)

0276

02713

02746

01607

01354

01829

00490

01704

0116

701341

01312

006

79(s2c3)

02557

02505

02540

0110

400763

01418

-00557

01227

004

2000737

006

47-00221

(s2c4)

02355

02298

02334

006

0300173

01007

-016

0300750

-00325

00134

-00016

-01120

(s2c5)

02153

02091

02129

00102

-00416

00597

-0264

700274

-010

69-00469

-00678

-02018

(s3c0)

030

85030

46030

7602448

02348

02514

02225

02504

02428

02356

02431

02206

(s3c1)

02881

02838

02869

01945

01756

02102

0117

502026

01680

01751

01765

01304

(s3c2)

02678

02630

02663

01442

01164

01690

00127

01548

00933

0114

601100

004

02(s3c3)

02476

02422

02457

00940

00574

01279

-00919

01071

00187

00543

00436

-00498

(s3c4)

02273

02215

02252

00439

-00016

00868

-019

6400595

-00558

-0006

-00227

-013

97(s3c5)

02071

02008

02047

-00062

-0060

5004

58-0300

800119

-013

02-00662

-00889

-02294

(s4c0)

03003

02962

02993

02284

02157

02374

01862

02348

02193

02161

02219

01929

(s4c1)

02799

02754

02786

01781

01565

01962

00813

01870

01445

01556

01554

01026

(s4c2)

02597

02547

02580

01278

00974

01551

-00235

01392

00699

00952

00889

00125

(s4c3)

02394

02339

02375

00776

00384

0114

0-012

8100915

-0004

700349

00226

-00774

(s4c4)

02192

02132

02169

00275

-00205

00729

-02326

00439

-00792

-00254

-00437

-016

73(s4c5)

01989

01926

01964

-00225

-00794

00319

-033

69-00037

-015

35-00856

-010

99-02570

Mathematical Problems in Engineering 21

the transaction cost structures (s0 c1) (s0 c2) (s0 c3) (s0c4) (s0 c5) if we do not consider transparent transactioncost ie c=0 the average ARR of RNN is 02531 under thetransaction cost structure (s1 c0) (s2 c0) (s3 c0) (s4c0) so transparent transaction cost has greater impact thanslippage Through multiple comparative analysis the ARRunder the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s0 c1) are not significantly different from the ARRwithout transaction cost for MLP DBN and SAE the ARRunder all other transaction cost structures are significantlysmaller than theARRwithout transaction cost For all tradingalgorithms except for MLP DBN and SAE the ARR underthe transaction cost structures (s1 c0) (s2 c0) are notsignificantly different from the ARR without transactioncost the ARR under all other transaction cost structures aresignificantly smaller than the ARR without transaction cost

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 26 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theASR of each algorithm is the lowest Compared with settingwithout transaction cost the ASR of MLP DBN and SAEreduce by 3997 4123 and 4066 respectively while theASR of other trading algorithms reduce by more than 90compared with the case of no transaction cost Thereforeexcessive transaction cost will significantly reduce ASR Fora general setting of s and c ie (s c) = (002 0003) theASR of MLP DBN and SAE decrease by 2262 2336and 2302 respectively while the ASR of other algorithmsdecrease by more than 50 the ASR of CART and XGBdecrease by more than 100Therefore MLP DBN and SAEare more tolerant to transaction cost From single tradingalgorithm such as NB if we do not consider slippage ies=0 the average ASR of NB is 08052 under the transactioncost structure (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5)if we do not consider transparent transaction cost ie c=0the average ASR of NB is 14182 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has greater impact than slippage Throughmultiple comparative analysis the ASR under the transactioncost structures (s1 c0) (s2 c0) (s3 c0) (s0 c1) are notsignificantly different from the ASR without transaction costfor MLP DBN and SAE the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the ASR under the transaction cost structures(s1 c0) (s2 c0) are not significantly different from the ASRwithout transaction cost the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 27 MDD increases with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the settings without transaction cost theMDD of MLP DBN and SAE increase by 932 1108 and

1032 respectively The MDD of other trading algorithmsincrease by more than 80 compared with those withoutconsidering transaction costTherefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 483 580 and 533respectively while the MDD of other algorithms increase bymore than 35 and theMDDofCART RF andXGB increasebymore than 100Therefore MLP DBN and SAE are moretolerant to transaction cost As awhole theDNNmodels havestronger capacity to accommodate transaction cost than thetraditional ML models From single trading algorithm suchas GRU if we do not consider slippage ie s=0 the averageMDD of GRU is 04459 under the transaction cost structures(s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do notconsider transparent transaction cost ie c=0 the averageMDD of GRU is 03559 under the transaction cost structures(s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparent transactioncost has greater impact than slippage Through multiplecomparative analysis the MDD under any the transactioncost structure is not significantly different from the MDDwithout transaction cost for MLP DBN and SAE For alltrading algorithms except for MLP DBN and SAE such asLR the MDD under the transaction cost structures (s0 c1)(s1 c0) (s2 c0) (s3 c0) are not significantly different fromthe MDD without transaction cost the MDD under all othertransaction cost structures are significantly greater than theMDD without transaction cost

Through the analysis of the Table 27 performance eval-uation indicators we find that trading performance afterconsidering transaction cost will be worse than that withoutconsidering transaction cost as is in actual trading situationIt is noteworthy that the performance changes of DNNalgorithms especially MLP DBN and SAE are very smallafter considering transaction cost This shows that the threealgorithms have good tolerance to changes of transactioncost Especially for the MDD of the three algorithms thereis no significant difference with that with no transactioncost So we can consider applying them in actual tradingMeanwhile we conclude that the transparent transactioncost has greater impact on the trading performances thanthe slippage for SPICS This is because the prices of SPICSare too high when the transparent transaction cost is setto a certain percentage of turnover In actual transactionsspecial attention needs to be paid to the fact that the trans-action performance under most transaction cost structuresis significantly lower than the trading performance withoutconsidering transaction cost It is worth noting that theperformance of traditional ML algorithm is not worse thanthat ofDNNalgorithmswithout considering transaction costwhile the performance of DNN algorithms is better than thatof traditional ML algorithms after considering transactioncost

63 Analysis of Impact of Transaction Cost on the TradingPerformance of CSICS Similar to Section 62 we will discussthe impact of transaction cost on trading performance ofCSICS in the followings In the Chinese A-share marketthe transparent transaction cost is usually set to a certain

22 Mathematical Problems in Engineering

Table26Th

eASR

ofSP

ICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

1546

815

412

15502

15764

15571

15828

13927

16237

16763

15818

16018

16298

(s0c1)

1456

214

478

14577

1300

012

317

13565

09346

13554

12650

12472

12456

11294

(s0c2)

13639

13527

13635

10191

09015

11262

04657

10822

08482

09074

08846

06236

(s0c3)

12702

12561

12679

07355

05690

08929

-00085

08061

04298

05652

05216

0118

2(s0c4)

11751

11581

11709

04511

02366

06580

-04823

05291

00139

02234

01596

-03812

(s0c5)

1079

10591

10728

01678

-00931

04227

-09500

02534

-039

59-01152

-019

87-08696

(s1c0)

15121

1505

715

149

1492

714

606

15119

1244

915

424

1558

214

825

14974

1488

6(s1c1)

14208

14116

14217

12146

11334

12841

07823

12722

1144

711459

11394

09859

(s1c2)

13279

13159

13270

09325

08020

10526

03105

09977

07267

08048

07772

04792

(s1c3)

12337

12188

12308

064

8204690

08185

-016

4607209

03082

04622

04139

-00257

(s1c4)

11382

11204

11333

03637

01368

05831

-06374

04438

-010

6801208

00524

-052

31(s1c5)

10417

10210

10348

00807

-019

2003478

-110

2501686

-05146

-02169

-0304

7-10083

(s2c0)

1477

1469

914

792

1408

113

632

1440

310

946

1460

114

390

1382

213

922

1346

2(s2c1)

13851

13752

13854

11285

10343

12111

06283

11883

10237

10439

10325

08416

(s2c2)

12916

12789

12901

08454

07021

09785

01547

09128

060

4907019

06696

03346

(s2c3)

11969

11812

11934

05607

03688

07437

-032

0506355

01868

03591

03063

-016

90(s2c4)

11010

10825

10955

02763

00372

05081

-07916

03586

-02268

00183

-00545

-06639

(s2c5)

1004

109827

09967

-0006

-02905

02729

-12533

00841

-06323

-031

79-04101

-114

54(s3c0)

14415

14337

14432

13227

12650

13679

09425

13770

13189

12810

12862

12030

(s3c1)

13490

13384

13488

10419

09348

11375

04733

11039

09023

09413

09252

06971

(s3c2)

12551

12416

12529

07580

060

19090

40-00013

08275

04832

05988

05618

01904

(s3c3)

11599

11435

11558

04731

02688

066

88-04757

05500

00658

02562

01988

-031

16(s3c4)

10636

10443

10575

01891

-00620

04331

-0944

202735

-0346

0-00836

-016

08-08034

(s3c5)

09664

09443

09584

-00924

-03883

01982

-14018

000

00-074

89-04183

-05146

-12808

(s4c0)

14058

13972

1406

812

368

11662

12950

07892

12933

11983

11793

11796

10591

(s4c1)

13127

13013

13119

09549

08350

10634

03180

10190

07807

08386

08177

05527

(s4c2)

12183

1204

12155

06705

05018

08293

-015

6807421

03617

04958

04542

004

68(s4c3)

11226

11055

11179

03857

01691

05938

-06295

046

47-00545

01537

00918

-04529

(s4c4)

1026

1006

10193

01021

-016

0703582

-10948

01888

-0464

2-018

49-02665

-09413

(s4c5)

09286

09057

09199

-017

83-04853

01238

-15478

-00836

-0864

2-05177

-06182

-14142

Mathematical Problems in Engineering 23

Table 27 The MDD of SPICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 03583 03584 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338(s0 c1) 03629 03638 03594 03779 03986 03636 04072 03712 03843 03963 03972 04203(s0 c2) 03677 03695 03647 04302 04707 03968 05168 04127 04842 04729 04787 05735(s0 c3) 03727 03756 03703 04990 05639 04376 06564 04709 06172 05682 05844 07335(s0 c4) 03781 03821 03764 05767 06612 04873 07804 05424 07377 06653 06913 08447(s0 c5) 03839 03890 03828 06529 0746 05444 08730 06162 08272 07501 07808 09118(s1 c0) 03596 03600 03560 03500 036130 03446 03574 03502 03414 03585 03569 03540(s1 c1) 03642 03655 03609 03907 04156 03717 04320 03814 04067 04154 04170 04541(s1 c2) 03691 03712 03662 04466 04936 04066 05534 04270 05172 04971 05049 06168(s1 c3) 03742 03774 03720 05183 05895 04495 06928 04885 06499 05937 06129 07662(s1 c4) 03796 03839 03781 05961 06842 05013 08105 05610 07631 06884 07161 08649(s1 c5) 03856 03909 03847 0671 07646 05595 08946 06342 08451 07691 0800 09235(s2 c0) 03609 03615 03573 03607 03756 03517 03770 03586 03586 03739 03727 03787(s2 c1) 03656 03671 03623 04047 04349 03805 04627 03929 04339 04365 04397 04929(s2 c2) 03705 03729 03678 04642 05176 04171 05916 04424 05504 05218 05327 06577(s2 c3) 03756 03792 03736 05377 06143 04624 07277 05067 06805 06183 06402 07939(s2 c4) 03812 03859 03799 06155 07056 05161 08380 05796 07856 07099 07388 08816(s2 c5) 03873 03930 03866 06887 07816 05751 09126 06517 08606 07864 08172 09331(s3 c0) 03622 03631 03588 03729 03912 03594 04004 03685 03795 03909 03909 04081(s3 c1) 03669 03687 03639 04200 04555 03901 04966 04062 04622 04587 04642 05334(s3 c2) 03719 03746 03694 04826 05423 04286 06295 04589 05833 05465 05607 06936(s3 c3) 03772 03811 03754 05572 06377 04762 07609 05248 07081 06420 06657 08175(s3 c4) 03829 03879 03818 06341 07254 05314 08620 05980 08054 07300 07593 08956(s3 c5) 03894 03954 03888 07056 07972 05909 09275 06689 08740 08022 08325 09412(s4 c0) 03635 03647 03602 03861 04082 03678 04274 03798 04015 04096 04114 04396(s4 c1) 03683 03704 03654 04362 04774 04005 05325 04211 04908 04814 04894 05730(s4 c2) 03734 03765 03712 05013 05664 04410 06667 04758 06142 05707 05875 07253(s4 c3) 03790 03833 03775 05765 06600 04905 07906 05429 07330 06644 06894 08375(s4 c4) 03851 03904 03841 06521 07439 05470 08824 06162 08230 07485 07782 09074(s4 c5) 03917 03981 03913 07218 08115 06067 09395 06857 08858 08165 08463 09480

percentage of turnover and it is the same as the assumptionin the experimental settings As in the US stock market thesmallest unit of price change is 001 (one tick) It is reasonableto set slippage to be 001-005 Of course it should be notedthat the prices fluctuation may be more intense when closingthan that in the middle of a trading day

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 28 the WR is decreasing with the increaseof transaction cost for any trading algorithm When thetransaction cost is set to (s c) = (004 0005) the WR of eachalgorithm is the smallest Comparedwith the settings withouttransaction cost the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR SVM and XGB are reduced by671 688 697 2269 1726 1548 2430 14912484 2112 2112 and 2919 respectively For a generalsetting of s and c ie (s c) = (002 0003) the WR ofMLP DBN and SAE decrease by 410 420 and 430respectively while the WR of other algorithms decrease bymore than 9 the WR of CART RF and XGB decrease by

more than 15 Therefore MLP DBN and SAE are moretolerant to transaction cost From single trading algorithmsuch as LSTM if we do not consider slippage ie s=0 theaverage WR of DBN is 05417 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage WR of LSTM is 05304 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the WR under the transactioncost structures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the WR without transaction cost for MLPDBN SAE and NB the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN SAE and NB the WR under the transaction coststructure (s0 c1) is not significantly different from the WRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

24 Mathematical Problems in Engineering

Table 28 The WR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803(s0 c1) 05523 05527 05525 05525 05608 05620 05009 05227 05612 05665 05571 05595(s0 c2) 05488 05492 05489 05389 05512 05535 04879 05149 05460 05542 05445 05411(s0 c3) 05453 05456 05452 05258 05414 05451 04747 05068 05313 05418 05320 05234(s0 c4) 05417 05419 05414 05127 05320 05368 04622 04991 05172 05297 05202 05067(s0 c5) 05383 05383 05379 05004 05230 05286 04504 04917 05036 05180 05088 04905(s1 c0) 05494 05499 05497 05444 05541 05558 04925 05170 05520 05584 05492 05488(s1 c1) 05456 05459 05456 05286 05424 05456 04775 05080 05342 05437 05345 05275(s1 c2) 05421 05423 05420 05161 05335 05377 04654 05007 05207 05320 05231 05110(s1 c3) 05386 05388 05383 05036 05246 05296 04530 04931 05065 05205 05116 04946(s1 c4) 05353 05354 05349 04915 05156 05218 04419 04861 04937 05095 05007 04795(s1 c5) 05323 05323 05317 04808 05076 05148 04315 04796 04817 04995 04905 04652(s2 c0) 05431 05434 05431 05219 05368 05403 04707 05036 05269 05374 05286 05189(s2 c1) 05395 05397 05393 05078 05266 05314 04573 04956 05115 05242 05154 05005(s2 c2) 05360 05361 05357 04960 05181 05237 04458 04886 04985 05134 05046 04853(s2 c3) 05331 05331 05326 04850 05100 05167 04352 04818 04864 05031 04945 04711(s2 c4) 05300 05300 05293 04743 05018 05093 04252 04752 04746 04931 04846 04572(s2 c5) 05273 05271 05266 04648 04946 05029 04159 04692 04639 04838 04755 04445(s3 c0) 05373 05374 05371 05019 05216 05265 04514 04917 05049 05186 05098 04932(s3 c1) 05341 05341 05336 04902 05128 05188 04399 04846 04917 05074 04990 04775(s3 c2) 05312 05312 05306 04798 05052 05122 04303 04782 04804 04977 04896 04644(s3 c3) 05281 05281 05275 04696 04976 05049 04206 04718 04689 04879 04799 04509(s3 c4) 05252 05251 05245 04598 04901 04984 04110 04657 04581 04785 04707 04378(s3 c5) 05226 05223 05218 04510 04833 04924 04023 04602 04481 04701 04621 04264(s4 c0) 05325 05325 05321 04860 05089 05150 04360 04816 04870 05030 04949 04723(s4 c1) 05294 05294 05289 04753 05010 05079 04258 04750 04752 04928 04849 04588(s4 c2) 05266 05265 05259 04653 04937 05013 04164 04690 04642 04838 04761 04458(s4 c3) 05238 05236 05230 04562 04864 04948 04073 04632 04541 04747 04672 04336(s4 c4) 05211 05208 05203 04475 04798 04891 03985 04577 04440 04662 04586 04218(s4 c5) 05186 05182 05176 04392 04733 04832 03901 04524 04348 04582 04509 04109

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 29 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the smallest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 5073 5175 and 5225 respectivelyWhile the ARR of other trading algorithms decrease bymore than 100 compared with those algorithms withouttransaction cost Therefore excessive transaction cost canlead to serious losses in the accounts For a general settingof s and c ie (s c) = (002 0003) ARR of MLP DBNand SAE decrease by 2741 2797 and 2825 respectivelywhile the ARR other algorithms decrease by more than 50and that of CART NB RF and XGB decrease by more than100 Therefore MLP DBN and SAE are more tolerant totransaction cost From single trading algorithm such as SAEif we do not consider slippage ie s=0 the average ARR ofSAE is 05040 under the transaction cost structure (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not consider

transparent transaction cost ie c=0 the averageARRof SAEis 04468 under the transaction cost structures (s1 c0) (s2c0) (s3 c0) (s4 c0) so transparent transaction cost hassmaller impact than slippage Through multiple comparativeanalysis the ARR under the transaction cost structures (s0c1) (s0 c2) (s0 c3) (s0 c1) (s1 c1) are not significantlydifferent from the ARR without transaction cost for MLPDBN and SAE the ARR under all other transaction coststructures are significantly smaller than the ARR withouttransaction cost For RNN LSTM GRU CART RF LR andSVM the ARR under the transaction cost structures (s0c1) (s0 c2) (s1 c0) are not significantly different fromthe ARR without transaction cost the ARR under all othertransaction cost structures are significantly smaller than theARR without transaction cost For NB and XGB the ARRunder the transaction cost structures (s0 c1) (s1 c0) arenot significantly different from the ARR without transactioncost the ARR under all other transaction cost structuresare significantly smaller than the ARR without transactioncost

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 14: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

14 Mathematical Problems in Engineering

Table 17Multiple comparison analysis between the RRof any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 09996 09996 10000LSTM 09309 09314 09781 09999GRU 09660 09663 09916 10000 10000CART 09744 09742 09225 05809 01509 02138NB 01093 01088 00574 00075 00004 00007 08861RF 00537 00534 00260 00028 00001 00002 07544 10000LR 00330 00328 00152 00015 00001 00001 06498 10000 10000SVM 03444 03434 02170 00434 00033 00059 09920 10000 09998 09991XGB 00193 00192 00085 00007 00000 00000 05344 10000 10000 10000 09960

Table 18 Multiple comparison analysis between the F1 of any two trading algorithmsThep value of the two trading strategieswith significantdifference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 10000 10000RNN 00000 00000 00000LSTM 00000 00000 00000 00000GRU 00000 00000 00000 00000 10000CART 00000 00000 00000 00000 07211 06670NB 00000 00000 00000 00136 00132 00099 08664RF 00000 00000 00000 00786 00016 00011 05162 10000LR 00000 00000 00000 00000 09440 09208 10000 05675 02181SVM 00000 00000 00000 00178 00000 00000 00000 00000 00000 00000XGB 00000 00000 00000 00001 03138 02679 10000 09937 08849 09964 00000

Table 19 Multiple comparison analysis between the AUC of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMDBN 10000SAE 09999 10000RNN 09945 09985 10000LSTM 05273 06382 09259 09937GRU 08448 09102 09958 10000 10000CART 06921 05835 02356 00801 00014 00096NB 00002 00001 00000 00000 00000 00000 02616RF 00001 00001 00000 00000 00000 00000 02002 10000LR 00000 00000 00000 00000 00000 00000 00930 10000 10000SVM 00027 00014 00001 00000 00000 00000 06454 10000 09999 09980XGB 00000 00000 00000 00000 00000 00000 01257 10000 10000 10000 09993

the results are shown in Table 18The number in the table is ap value of any two algorithms of Nemenyi test FromTables 14and 18 we can see that the F1 of MLP DBN and SAE have nosignificant difference but they are significantly greater thanthat of all other trading algorithms There is no significantdifference among traditionalML algorithms except SVM andthe F1 of SVM is significantly greater than that of all othertraditional ML algorithms

(5) Through the hypothesis test analysis of H5a and H5bwe can obtain p valuelt22e-16Therefore there are significantdifferences between theAUCof all trading algorithmsThere-fore we need to do further multiple comparative analysis andthe results are shown in Table 19 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 19 we can see that the AUC of all DNN models haveno significant difference There is no significant difference

Mathematical Problems in Engineering 15

Table 20 Multiple comparison analysis between the WR of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 04117MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00002 00006 00000LSTM 00000 00000 00000 00000 00000 09772GRU 00000 00000 00000 00000 00000 09911 10000CART 09931 00000 00000 00000 00000 00000 00000 00000NB 00031 00000 00001 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00205 06437 05358 00000 00000LR 00000 00000 00000 00000 00000 00010 01611 01105 00000 00000 10000SVM 00000 00000 00000 00000 00000 09914 10000 10000 00000 00000 05322 01090XGB 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000

Table 21Multiple comparison analysis between theARRof any two trading strategiesThepvalue of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00007MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 04790 06355 07182LSTM 00000 00000 02512 03806 04630 10000GRU 00000 00000 02235 03454 04249 10000 10000CART 00000 00000 08301 09217 09542 10000 09999 09998NB 00000 00000 10000 10000 10000 02920 01295 01125 06517RF 00000 00000 00020 00048 00076 08705 09735 09806 05393 00006LR 00000 00000 02058 03222 03995 10000 10000 10000 09996 01019 09845SVM 00000 00000 10000 00803 01114 09993 10000 10000 09659 00165 09999 10000XGB 00000 00000 10000 00333 00484 09916 09997 09998 08789 00057 10000 09999 10000

between the AUC of all traditional ML algorithms TheAUC of all traditional ML algorithms except for CART aresignificantly greater than that of any DNN model There isno significant difference among the AUC ofMLP SAE DBNRNN and CART

(6)Through the hypothesis test analysis of H6a and H6bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the WR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 20 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 20 we can see that the WR of BAH and benchmarkindex have no significant difference but they are significantlysmaller than that of anyML algorithmTheWRofMLPDBNand SAE are significantly smaller than that of the other trad-ing algorithms but there is no significant difference betweenthe WR of MLP DBN and SAE The WR of LSTM andGRU have no significant difference but they are significantlysmaller than that of XGB and significantly greater than that of

CART and NB In traditional MLmodels the WR of NB andCART are significantly smaller than that of other algorithmsThe WR of XGB is significantly greater than that of all otherML algorithms

(7)Through the analysis of the hypothesis test of H7a andH7b we obtain p valuelt22e-16

Therefore there are significant differences between theARR of all trading strategies including the benchmark indexand BAH strategy Therefore we need to do further multiplecomparative analysis and the results are shown in Table 21FromTables 14 and 21 we can see that ARR of the benchmarkindex and BAH are significantly smaller than that of alltrading algorithms The ARR of MLP is significantly higherthan that of RF but there is no significant difference betweenMLP and other algorithms The ARR of SAE and DBN aresignificantly higher than that of RF and XGB but they arenot significantly different fromARR of other algorithms TheARR of NB is significantly higher than that of RF SVMand XGB But otherwise there is no significant difference

16 Mathematical Problems in Engineering

Table 22Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 08877MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 09099 08862 08114LSTM 00000 00000 03460 03080 02239 09999GRU 00000 00000 02132 01853 01270 09981 10000CART 00000 00000 00158 00195 00327 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000 00000 07298RF 00000 00000 10000 10000 10000 09968 07444 05789 00018 00000LR 00000 00000 01181 01003 00650 09879 10000 10000 00000 00000 04044SVM 00000 00000 10000 10000 10000 09849 05952 04238 00042 00000 10000 02704XGB 00000 00000 09937 09902 09746 10000 09878 09532 00001 00000 10000 08723 09998

Table 23 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00006DBN 00000 00004 10000SAE 00000 00023 10000 10000RNN 00000 00000 00320 00421 00111LSTM 00000 00000 00002 00003 00000 09947GRU 00000 00000 00001 00001 00000 09767 10000CART 00000 00000 01238 01538 00521 10000 09241 08305NB 00000 01875 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 01180 01469 00493 10000 09298 08401 10000 00000LR 00000 00000 00001 00002 00000 09881 10000 10000 08821 00000 08898SVM 00000 00000 03285 03839 01701 09999 07011 05424 10000 00000 10000 06216XGB 00000 00000 00308 00405 00106 10000 09951 09783 10000 00000 10000 09890 09998

between any other two algorithms Therefore the ARR ofmost traditional ML models are not significantly worse thanthat of the best DNNmodel

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore There are significantdifferences betweenASRof all trading strategies including thebenchmark index and BAH strategy The results of multiplecomparative analysis are shown in Table 22 From Tables 14and 22 we can see that the ASR of the benchmark indexand BAH are significantly smaller than that of all tradingalgorithms The ASR of all ML algorithms are significantlyhigher than that of CART and NB but there is no significantdifference between the ASR of CART and NB Beyond thatthere is no significant difference between any other twoalgorithms Therefore the ASR of all traditional ML modelsexcept NB and CART are not significantly worse than that ofany DNNmodel

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between the MDD of these trading strategies

including the benchmark index and the BAH strategyThe results of multiple comparative analysis are shown inTable 23 From Tables 14 and 23 we can see that the MDDof the benchmark index is significantly smaller than that ofother trading strategies including BAH strategy TheMDD ofBAH is significantly greater than that of all trading algorithmsexcept NBTheMDDofMLPDBN and SAE are significantlylower than that of NB but significantly higher than thatof RNN LSTM GRU LR and XGB The MDD of NB issignificantly greater than that of all other trading algorithmsBeyond that there is no significant difference between anyother two algorithms Therefore all ML algorithms expectNB especially LSTM RNN GRU LR and XGB can play arole in controlling trading risk

In a word some DNN models such as MLP DBN andSAE have good performance in AR PR and F1 traditionalML algorithms such as LR and XGB have good performanceinAUCandWRTheARRof some traditionalML algorithmssuch as CART NB LR and SVM are not significantlydifferent from that of the six DNN models The ASR of the

Mathematical Problems in Engineering 17

six DNN algorithms are not significantly different from alltraditional ML models except NB and CART The MDD ofLR and XGB are significantly smaller than those of MLPDBN and SAE and are not significantly different fromthat of LSTM GRU and RNN The ARR and ASR of allML algorithms are significantly greater than those of BAHand benchmark index the MDD of all ML algorithms aresignificantly smaller than that of the benchmark index butsignificantly greater than that of BAH strategy

From the above analysis and evaluation we can see thatthe directional evaluation indicators of some DNN modelsare very competitive in CSICS while the indicators of sometraditional ML algorithms have excellent performance inSPICS Whether in SPICS or CSICS the ARR and ASR ofall ML algorithms are significantly greater than that of thebenchmark index and BAH strategy respectively In all MLalgorithms there are always some traditional ML algorithmswhich are not significantly worse than the best DNN modelfor any performance evaluation indicator (ARR ASR andMDD)Therefore if we do not consider transaction cost andother factors affecting trading performance of DNN modelsare alternative but not the best choice when they are appliedto stock trading

In the same period the ARR of any ML algorithm inCSICS is significantly greater than that of the same algorithmin SPICS (p valuelt0001 in theNemenyi test)Meanwhile theMDD of any ML algorithm in CSICS is significantly greaterthan that of the same algorithm in SPICS (p value lt0001in the Nemenyi test) The results show that the quantitativetrading algorithms can more easily obtain excess returns inthe Chinese A-share market but the volatility risk of tradingin Chinese A-share market is significantly higher than that ofthe US stock market in the past 8 years

6 The Impact of Transaction Cost onPerformance of ML Algorithms

Trading cost can affect the profitability of a stock tradingstrategy Transaction cost that can be ignored in long-termstrategies is significantly magnified in daily trading Howevermany algorithmic trading studies assume that transactioncost does not exist ([10 17] etc) In practice frictions suchas transaction cost can distort the market from the perfectmodel in textbooks The cost known prior to trading activityis referred to as transparent such as commissions exchangefees and taxes The costs that has to be estimated are knownas implicit including comprise bid-ask spread latency orslippage and related market impact This section focuses onthe transparent and implicit cost and how do they affecttrading performance in daily trading

61 Experimental Settings and Backtesting Algorithm In thispart the transparent transaction cost is calculated by a certainpercentage of transaction turnover for convenience theimplicit transaction cost is very complicated in calculationand it is necessary to make a reasonable estimate for therandom changes of market environment and stock pricesTherefore we only discuss the impact of slippage on tradingperformance

The transaction cost structures of American stocks aresimilar to that of Chinese A-shares We assume that transpar-ent transaction cost is calculated by a percentage of turnoversuch as less than 05 [40 41] and 02 and 05 in theliterature [42] It is different for the estimation of slippage

In some quantitative trading simulation software such asJoinQuant [43] and Abuquant [44] the slippage is set to 002The transparent transaction cost and implicit transaction costare charged in both directions when buying and selling Itis worth noting that the transparent transaction cost varieswith the different brokers while the implicit transaction costis related to market liquidity market information networkstatus trading software etc

We set slippages s = s0=0 s1=001 s2=002 s3=003s4=004 the transparent transaction cost c = c0=0 c1=0001c2=0002 c3=0003 c4=0004 c5=0005 For different s ccombinations we study the impact of different transactioncost structures on trading performance We assume thatbuying and selling positions are one unit so the turnover isthe corresponding stock price When buying stocks we notonly need to pay a certain percentage cost of the purchaseprice but also need to pay an uncertain slippage cost Thatis we need to pay a higher price than the real-time price119875119905minus1

when we are buying But when selling stocks we notonly need to pay a certain percentage cost of the sellingprice but also to pay an uncertain slippage cost Generallyspeaking we need to sell at a price lower than the real-timeprice 119875

119905 It is worth noting that our trading strategy is self-

financing If ML algorithms predict the continuous occur-rence of buying signals or selling signals ie |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 0 we will continue to hold or do nothingso the transaction cost at this time is 0 when |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 1 it is indicated that the position maybe changed from holding to selling or from empty positionto buying At this time we would pay transaction costdue to the trading operation Finally we get a real yieldis

119877119890119905119905le119862119897119900119904119890119875119903119894119888119890

119905minus 119862119897119900119904119890119875119903119894119888119890

119905minus1

119862119897119900119904119890119875119903119894119888119890119905minus1

119875119905= 119862119897119900119904119890119875119903119894119888119890

119905

lowast (1 minus 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816)

minus 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816

119875119905minus1

= 119862119897119900119904119890119875119903119894119888119890119905minus1

lowast (1 + 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816)

+ 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816

119877119890119905119905=119875119905minus 119875119905minus1

119875119905minus1

(5)

where 119862119897119900119904119890119875119903119894119888119890119905

denotes the 119905-th closing price119879119903119886119889119890119878119894119892119899119886119897

119905denotes the 119905-th trading signal 119875

119905denotes

the 119905-th executing price and 119877119890119905119905denotes the 119905-th return rate

We propose a backtesting algorithm with transaction costbased on the above analysis as is shown in Algorithm 3

18 Mathematical Problems in Engineering

Input TS TS is trading signals of a stocks s is slippagec c is transparent transaction cost

Output WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) WR=NULL ARR=NULL ASR=NULL MDD=NULL(3) for (i in 1 N) (4) Stock Data=Stock Code List[i](5) ClosePricet=Stock Data [ldquoClosing Pricerdquo](6) Pt =ClosePricet lowast(1-clowastabs(TSt-TSt-1)) - slowastabs(TSt-TSt-1)(7) Pt-1 =ClosePricetlowast(1+clowastabs(TSt-TSt-1)) + slowastabs(TSt-TSt-1)(8) Rett= (Pt- Pt-1) Pt Ret is the return rate series(9) TDRR=lag (TS)lowastRet TDRR is the daily return through trading(10) WR[i]=sum (TDRRgt0)sum(TDRR =0)(11) ARR[i]=Returnannualized (TDRR)(12) ASR[i]=SharpeRatioannualized (TDRR)(13) MDD[i]=maxDrawDown (TDRR)(14) WR=c (WR WR[i])(15) ARR=c (ARR ARR[i])(16) ASR=c (ASR ASR[i])(17) MDD=c (MDD MDD[i])(18) (19) return (WR ARR ASR MDD)

Algorithm 3 Backtesting algorithm with transaction cost in R language

62 Analysis of Impact of Transaction Cost on the TradingPerformance of SPICS Transaction cost is one of the mostimportant factors affecting trading performance In US stocktrading transparent transaction cost can be charged accord-ing to a fixed fee per order or month or a floating fee basedon the volume and turnover of each transaction Sometimescustomers can also negotiate with broker to determinetransaction cost The transaction cost charged by differentbrokers varies greatly Meanwhile implicit transaction costis not known beforehand and the estimations of them arevery complex Therefore we assume that the percentageof turnover is the transparent transaction cost for ease ofcalculation In the aspect of implicit transaction cost we onlyconsider the impact of slippage on trading performance

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 24 WR is decreasing with the increase oftransaction cost for any trading algorithm which is intuitiveWhen the transaction cost is set to (s c) = (004 0005) theWR of each algorithm is the lowest Compared with setting(s c) = (0 0) the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR and SVM to XGB are reduced by580 597 591 1583 1804 1395 2171 16042216 1854 1850 and 2597 respectively ThereforeMLP DBN and SAE are more tolerant to transaction costGenerally speaking the DNN models have stronger capacityto accommodate transaction cost than the traditional MLmodels From the single trading algorithm such as MLP ifwe do not consider slippage ie s=0 the average WR ofMLP is 05510 under transaction cost structures (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not considertransparent transaction cost ie c=0 the averageWRofMLP

is 05618 under transaction cost structures (s1 c0) (s2 c0)(s3 c0) (s4 c0) so transparent transaction cost has greaterimpact than slippageThroughmultiple comparative analysisthe WR under the transaction cost structure (s1 c0) is notsignificantly different from the WR without transaction costfor MLP DBN and SAETheWR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the WR under the transaction cost structure (s1 c0) (s2 c0) are not significantly different from theWRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 25 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the lowest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 4031 4157 and 4093 respectivelywhile the ARR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin accounts For a general setting of s and c ie (s c) = (0020003) ARR of MLP DBN and SAE decrease by 23262400 and 2361 respectively while the ARR of otheralgorithms decrease by more than 50 and that of CARTand XGB decrease bymore than 100ThereforeMLP DBNand SAE are more tolerant to high transaction cost Fromsingle trading algorithm such as RNN if we do not considerslippage ie s=0 the average ARR of RNN is 01434 under

Mathematical Problems in Engineering 19

Table24Th

eWRof

SPICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

05676

05680

05683

05843

05825

05844

05266

05930

05912

05859

05831

05891

(s0c1)

05615

05618

05621

05669

05626

05694

05052

05752

05663

05654

05630

05599

(s0c2)

05560

05560

05564

05507

05442

05553

04847

05585

05429

05463

05438

05324

(s0c3)

05507

05506

05510

05353

05269

05418

04652

05424

05205

05278

05253

05061

(s0c4)

05457

05454

05460

05206

05101

05289

044

7005277

04996

05105

05084

04818

(s0c5)

05410

05407

05412

05071

04946

05170

04303

05138

04803

04947

04924

04594

(s1c0)

056

49056

53056

5605778

05751

05785

05190

058

61058

2405782

05759

05788

(s1c1)

05594

05597

05600

05619

05571

05648

04991

05700

05597

05595

05574

05521

(s1c2)

05539

05539

05544

05458

05389

05508

04788

05534

05364

05406

05383

05249

(s1c3)

05487

05486

05491

05305

05215

05375

04597

05375

05141

05223

05200

04988

(s1c4)

05438

05436

05441

05163

05052

05249

044

1805231

04938

05054

05034

04750

(s1c5)

05394

05390

05396

05032

04902

05132

04255

05097

04751

04900

04880

04532

(s2c0)

05628

05631

05635

05729

056

9705741

05134

058

1105758

05726

05704

05713

(s2c1)

05573

05574

05578

05568

05515

05602

04931

05647

05527

05535

05515

05442

(s2c2)

05518

05518

05523

05408

05336

05463

04729

05482

05297

05349

05326

05172

(s2c3)

05469

05467

05472

05260

05164

05334

04543

05330

05082

05171

05150

04918

(s2c4)

05421

05417

05423

05120

05004

05209

04368

05187

04881

05004

04986

046

85(s2c5)

05377

05373

05379

04993

04858

05096

04209

05055

04699

04855

04835

044

73(s3c0)

05606

05609

05612

05678

05640

05694

05074

05759

05690

05668

05646

05635

(s3c1)

05552

05553

05558

05518

05460

05556

04872

05595

05460

05478

05459

05365

(s3c2)

05499

05498

05503

05362

05284

05422

046

7505434

05233

05295

05273

05099

(s3c3)

05450

05448

05453

05216

05114

05292

04491

05284

05020

05120

05098

04849

(s3c4)

05405

05401

05407

05080

04960

05172

04321

05146

04827

04959

04940

04622

(s3c5)

05362

05357

05363

04955

04816

05063

04166

05017

04651

04815

04793

044

17(s4c0)

05587

05589

05593

05630

05588

05652

05019

05710

05627

05613

05593

05562

(s4c1)

05533

05533

05537

05470

05407

05513

04815

05544

05395

05424

05404

05290

(s4c2)

05480

05479

05484

05316

05232

05380

04620

05386

05171

05242

05220

05026

(s4c3)

05432

05429

05435

05172

05067

05253

044

4005241

04964

05070

05051

04782

(s4c4)

05388

05384

05391

05041

04917

05137

04274

05106

04775

04914

04897

04564

(s4c5)

05347

05341

05347

04918

04774

05029

04123

04979

046

0204773

04752

04361

20 Mathematical Problems in Engineering

Table25Th

eARR

ofSP

ICSford

ailytradingwith

different

transactioncost

Ther

esultthatthere

isno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

03332

03296

03325

02943

02920

02934

03317

02975

03133

02942

03067

03041

(s0c1)

03128

030

8703118

02439

02327

02521

02266

02496

02384

02336

02400

02137

(s0c2)

02924

02879

02912

01936

01735

02108

01216

02017

01636

01731

01734

01234

(s0c3)

02721

02672

02706

01433

0114

301697

00168

01539

00889

01126

01070

00333

(s0c4)

02519

02464

02500

00931

00553

01285

-00878

01062

00143

00522

004

06-00567

(s0c5)

02316

02257

02294

00430

-00037

00875

-019

2400586

-00602

-0008

-00257

-014

66(s1c0)

03249

03212

03242

027

7802729

02794

029

53028

18028

9802747

028

5502762

(s1c1)

03046

03004

03035

02274

02136

02381

01902

02339

02149

02141

02188

01859

(s1c2)

02842

02796

02829

01771

01544

01969

00853

01861

01401

01536

01523

00957

(s1c3)

02639

02588

02623

01269

00953

01557

-00195

01383

00654

00931

00858

000

56(s1c4)

02437

02381

02417

00767

00363

0114

6-012

41009

06-00091

00328

00195

-00844

(s1c5)

02234

02174

02211

00266

-00226

00735

-02285

00430

-00836

-00275

-0046

8-01742

(s2c0)

03167

03129

03159

026

1302538

026

54025

89026

61026

6302551

026

43024

84(s2c1)

02964

02921

02952

02110

01946

02241

01539

02182

01914

01946

01977

01581

(s2c2)

0276

02713

02746

01607

01354

01829

00490

01704

0116

701341

01312

006

79(s2c3)

02557

02505

02540

0110

400763

01418

-00557

01227

004

2000737

006

47-00221

(s2c4)

02355

02298

02334

006

0300173

01007

-016

0300750

-00325

00134

-00016

-01120

(s2c5)

02153

02091

02129

00102

-00416

00597

-0264

700274

-010

69-00469

-00678

-02018

(s3c0)

030

85030

46030

7602448

02348

02514

02225

02504

02428

02356

02431

02206

(s3c1)

02881

02838

02869

01945

01756

02102

0117

502026

01680

01751

01765

01304

(s3c2)

02678

02630

02663

01442

01164

01690

00127

01548

00933

0114

601100

004

02(s3c3)

02476

02422

02457

00940

00574

01279

-00919

01071

00187

00543

00436

-00498

(s3c4)

02273

02215

02252

00439

-00016

00868

-019

6400595

-00558

-0006

-00227

-013

97(s3c5)

02071

02008

02047

-00062

-0060

5004

58-0300

800119

-013

02-00662

-00889

-02294

(s4c0)

03003

02962

02993

02284

02157

02374

01862

02348

02193

02161

02219

01929

(s4c1)

02799

02754

02786

01781

01565

01962

00813

01870

01445

01556

01554

01026

(s4c2)

02597

02547

02580

01278

00974

01551

-00235

01392

00699

00952

00889

00125

(s4c3)

02394

02339

02375

00776

00384

0114

0-012

8100915

-0004

700349

00226

-00774

(s4c4)

02192

02132

02169

00275

-00205

00729

-02326

00439

-00792

-00254

-00437

-016

73(s4c5)

01989

01926

01964

-00225

-00794

00319

-033

69-00037

-015

35-00856

-010

99-02570

Mathematical Problems in Engineering 21

the transaction cost structures (s0 c1) (s0 c2) (s0 c3) (s0c4) (s0 c5) if we do not consider transparent transactioncost ie c=0 the average ARR of RNN is 02531 under thetransaction cost structure (s1 c0) (s2 c0) (s3 c0) (s4c0) so transparent transaction cost has greater impact thanslippage Through multiple comparative analysis the ARRunder the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s0 c1) are not significantly different from the ARRwithout transaction cost for MLP DBN and SAE the ARRunder all other transaction cost structures are significantlysmaller than theARRwithout transaction cost For all tradingalgorithms except for MLP DBN and SAE the ARR underthe transaction cost structures (s1 c0) (s2 c0) are notsignificantly different from the ARR without transactioncost the ARR under all other transaction cost structures aresignificantly smaller than the ARR without transaction cost

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 26 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theASR of each algorithm is the lowest Compared with settingwithout transaction cost the ASR of MLP DBN and SAEreduce by 3997 4123 and 4066 respectively while theASR of other trading algorithms reduce by more than 90compared with the case of no transaction cost Thereforeexcessive transaction cost will significantly reduce ASR Fora general setting of s and c ie (s c) = (002 0003) theASR of MLP DBN and SAE decrease by 2262 2336and 2302 respectively while the ASR of other algorithmsdecrease by more than 50 the ASR of CART and XGBdecrease by more than 100Therefore MLP DBN and SAEare more tolerant to transaction cost From single tradingalgorithm such as NB if we do not consider slippage ies=0 the average ASR of NB is 08052 under the transactioncost structure (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5)if we do not consider transparent transaction cost ie c=0the average ASR of NB is 14182 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has greater impact than slippage Throughmultiple comparative analysis the ASR under the transactioncost structures (s1 c0) (s2 c0) (s3 c0) (s0 c1) are notsignificantly different from the ASR without transaction costfor MLP DBN and SAE the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the ASR under the transaction cost structures(s1 c0) (s2 c0) are not significantly different from the ASRwithout transaction cost the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 27 MDD increases with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the settings without transaction cost theMDD of MLP DBN and SAE increase by 932 1108 and

1032 respectively The MDD of other trading algorithmsincrease by more than 80 compared with those withoutconsidering transaction costTherefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 483 580 and 533respectively while the MDD of other algorithms increase bymore than 35 and theMDDofCART RF andXGB increasebymore than 100Therefore MLP DBN and SAE are moretolerant to transaction cost As awhole theDNNmodels havestronger capacity to accommodate transaction cost than thetraditional ML models From single trading algorithm suchas GRU if we do not consider slippage ie s=0 the averageMDD of GRU is 04459 under the transaction cost structures(s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do notconsider transparent transaction cost ie c=0 the averageMDD of GRU is 03559 under the transaction cost structures(s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparent transactioncost has greater impact than slippage Through multiplecomparative analysis the MDD under any the transactioncost structure is not significantly different from the MDDwithout transaction cost for MLP DBN and SAE For alltrading algorithms except for MLP DBN and SAE such asLR the MDD under the transaction cost structures (s0 c1)(s1 c0) (s2 c0) (s3 c0) are not significantly different fromthe MDD without transaction cost the MDD under all othertransaction cost structures are significantly greater than theMDD without transaction cost

Through the analysis of the Table 27 performance eval-uation indicators we find that trading performance afterconsidering transaction cost will be worse than that withoutconsidering transaction cost as is in actual trading situationIt is noteworthy that the performance changes of DNNalgorithms especially MLP DBN and SAE are very smallafter considering transaction cost This shows that the threealgorithms have good tolerance to changes of transactioncost Especially for the MDD of the three algorithms thereis no significant difference with that with no transactioncost So we can consider applying them in actual tradingMeanwhile we conclude that the transparent transactioncost has greater impact on the trading performances thanthe slippage for SPICS This is because the prices of SPICSare too high when the transparent transaction cost is setto a certain percentage of turnover In actual transactionsspecial attention needs to be paid to the fact that the trans-action performance under most transaction cost structuresis significantly lower than the trading performance withoutconsidering transaction cost It is worth noting that theperformance of traditional ML algorithm is not worse thanthat ofDNNalgorithmswithout considering transaction costwhile the performance of DNN algorithms is better than thatof traditional ML algorithms after considering transactioncost

63 Analysis of Impact of Transaction Cost on the TradingPerformance of CSICS Similar to Section 62 we will discussthe impact of transaction cost on trading performance ofCSICS in the followings In the Chinese A-share marketthe transparent transaction cost is usually set to a certain

22 Mathematical Problems in Engineering

Table26Th

eASR

ofSP

ICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

1546

815

412

15502

15764

15571

15828

13927

16237

16763

15818

16018

16298

(s0c1)

1456

214

478

14577

1300

012

317

13565

09346

13554

12650

12472

12456

11294

(s0c2)

13639

13527

13635

10191

09015

11262

04657

10822

08482

09074

08846

06236

(s0c3)

12702

12561

12679

07355

05690

08929

-00085

08061

04298

05652

05216

0118

2(s0c4)

11751

11581

11709

04511

02366

06580

-04823

05291

00139

02234

01596

-03812

(s0c5)

1079

10591

10728

01678

-00931

04227

-09500

02534

-039

59-01152

-019

87-08696

(s1c0)

15121

1505

715

149

1492

714

606

15119

1244

915

424

1558

214

825

14974

1488

6(s1c1)

14208

14116

14217

12146

11334

12841

07823

12722

1144

711459

11394

09859

(s1c2)

13279

13159

13270

09325

08020

10526

03105

09977

07267

08048

07772

04792

(s1c3)

12337

12188

12308

064

8204690

08185

-016

4607209

03082

04622

04139

-00257

(s1c4)

11382

11204

11333

03637

01368

05831

-06374

04438

-010

6801208

00524

-052

31(s1c5)

10417

10210

10348

00807

-019

2003478

-110

2501686

-05146

-02169

-0304

7-10083

(s2c0)

1477

1469

914

792

1408

113

632

1440

310

946

1460

114

390

1382

213

922

1346

2(s2c1)

13851

13752

13854

11285

10343

12111

06283

11883

10237

10439

10325

08416

(s2c2)

12916

12789

12901

08454

07021

09785

01547

09128

060

4907019

06696

03346

(s2c3)

11969

11812

11934

05607

03688

07437

-032

0506355

01868

03591

03063

-016

90(s2c4)

11010

10825

10955

02763

00372

05081

-07916

03586

-02268

00183

-00545

-06639

(s2c5)

1004

109827

09967

-0006

-02905

02729

-12533

00841

-06323

-031

79-04101

-114

54(s3c0)

14415

14337

14432

13227

12650

13679

09425

13770

13189

12810

12862

12030

(s3c1)

13490

13384

13488

10419

09348

11375

04733

11039

09023

09413

09252

06971

(s3c2)

12551

12416

12529

07580

060

19090

40-00013

08275

04832

05988

05618

01904

(s3c3)

11599

11435

11558

04731

02688

066

88-04757

05500

00658

02562

01988

-031

16(s3c4)

10636

10443

10575

01891

-00620

04331

-0944

202735

-0346

0-00836

-016

08-08034

(s3c5)

09664

09443

09584

-00924

-03883

01982

-14018

000

00-074

89-04183

-05146

-12808

(s4c0)

14058

13972

1406

812

368

11662

12950

07892

12933

11983

11793

11796

10591

(s4c1)

13127

13013

13119

09549

08350

10634

03180

10190

07807

08386

08177

05527

(s4c2)

12183

1204

12155

06705

05018

08293

-015

6807421

03617

04958

04542

004

68(s4c3)

11226

11055

11179

03857

01691

05938

-06295

046

47-00545

01537

00918

-04529

(s4c4)

1026

1006

10193

01021

-016

0703582

-10948

01888

-0464

2-018

49-02665

-09413

(s4c5)

09286

09057

09199

-017

83-04853

01238

-15478

-00836

-0864

2-05177

-06182

-14142

Mathematical Problems in Engineering 23

Table 27 The MDD of SPICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 03583 03584 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338(s0 c1) 03629 03638 03594 03779 03986 03636 04072 03712 03843 03963 03972 04203(s0 c2) 03677 03695 03647 04302 04707 03968 05168 04127 04842 04729 04787 05735(s0 c3) 03727 03756 03703 04990 05639 04376 06564 04709 06172 05682 05844 07335(s0 c4) 03781 03821 03764 05767 06612 04873 07804 05424 07377 06653 06913 08447(s0 c5) 03839 03890 03828 06529 0746 05444 08730 06162 08272 07501 07808 09118(s1 c0) 03596 03600 03560 03500 036130 03446 03574 03502 03414 03585 03569 03540(s1 c1) 03642 03655 03609 03907 04156 03717 04320 03814 04067 04154 04170 04541(s1 c2) 03691 03712 03662 04466 04936 04066 05534 04270 05172 04971 05049 06168(s1 c3) 03742 03774 03720 05183 05895 04495 06928 04885 06499 05937 06129 07662(s1 c4) 03796 03839 03781 05961 06842 05013 08105 05610 07631 06884 07161 08649(s1 c5) 03856 03909 03847 0671 07646 05595 08946 06342 08451 07691 0800 09235(s2 c0) 03609 03615 03573 03607 03756 03517 03770 03586 03586 03739 03727 03787(s2 c1) 03656 03671 03623 04047 04349 03805 04627 03929 04339 04365 04397 04929(s2 c2) 03705 03729 03678 04642 05176 04171 05916 04424 05504 05218 05327 06577(s2 c3) 03756 03792 03736 05377 06143 04624 07277 05067 06805 06183 06402 07939(s2 c4) 03812 03859 03799 06155 07056 05161 08380 05796 07856 07099 07388 08816(s2 c5) 03873 03930 03866 06887 07816 05751 09126 06517 08606 07864 08172 09331(s3 c0) 03622 03631 03588 03729 03912 03594 04004 03685 03795 03909 03909 04081(s3 c1) 03669 03687 03639 04200 04555 03901 04966 04062 04622 04587 04642 05334(s3 c2) 03719 03746 03694 04826 05423 04286 06295 04589 05833 05465 05607 06936(s3 c3) 03772 03811 03754 05572 06377 04762 07609 05248 07081 06420 06657 08175(s3 c4) 03829 03879 03818 06341 07254 05314 08620 05980 08054 07300 07593 08956(s3 c5) 03894 03954 03888 07056 07972 05909 09275 06689 08740 08022 08325 09412(s4 c0) 03635 03647 03602 03861 04082 03678 04274 03798 04015 04096 04114 04396(s4 c1) 03683 03704 03654 04362 04774 04005 05325 04211 04908 04814 04894 05730(s4 c2) 03734 03765 03712 05013 05664 04410 06667 04758 06142 05707 05875 07253(s4 c3) 03790 03833 03775 05765 06600 04905 07906 05429 07330 06644 06894 08375(s4 c4) 03851 03904 03841 06521 07439 05470 08824 06162 08230 07485 07782 09074(s4 c5) 03917 03981 03913 07218 08115 06067 09395 06857 08858 08165 08463 09480

percentage of turnover and it is the same as the assumptionin the experimental settings As in the US stock market thesmallest unit of price change is 001 (one tick) It is reasonableto set slippage to be 001-005 Of course it should be notedthat the prices fluctuation may be more intense when closingthan that in the middle of a trading day

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 28 the WR is decreasing with the increaseof transaction cost for any trading algorithm When thetransaction cost is set to (s c) = (004 0005) the WR of eachalgorithm is the smallest Comparedwith the settings withouttransaction cost the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR SVM and XGB are reduced by671 688 697 2269 1726 1548 2430 14912484 2112 2112 and 2919 respectively For a generalsetting of s and c ie (s c) = (002 0003) the WR ofMLP DBN and SAE decrease by 410 420 and 430respectively while the WR of other algorithms decrease bymore than 9 the WR of CART RF and XGB decrease by

more than 15 Therefore MLP DBN and SAE are moretolerant to transaction cost From single trading algorithmsuch as LSTM if we do not consider slippage ie s=0 theaverage WR of DBN is 05417 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage WR of LSTM is 05304 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the WR under the transactioncost structures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the WR without transaction cost for MLPDBN SAE and NB the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN SAE and NB the WR under the transaction coststructure (s0 c1) is not significantly different from the WRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

24 Mathematical Problems in Engineering

Table 28 The WR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803(s0 c1) 05523 05527 05525 05525 05608 05620 05009 05227 05612 05665 05571 05595(s0 c2) 05488 05492 05489 05389 05512 05535 04879 05149 05460 05542 05445 05411(s0 c3) 05453 05456 05452 05258 05414 05451 04747 05068 05313 05418 05320 05234(s0 c4) 05417 05419 05414 05127 05320 05368 04622 04991 05172 05297 05202 05067(s0 c5) 05383 05383 05379 05004 05230 05286 04504 04917 05036 05180 05088 04905(s1 c0) 05494 05499 05497 05444 05541 05558 04925 05170 05520 05584 05492 05488(s1 c1) 05456 05459 05456 05286 05424 05456 04775 05080 05342 05437 05345 05275(s1 c2) 05421 05423 05420 05161 05335 05377 04654 05007 05207 05320 05231 05110(s1 c3) 05386 05388 05383 05036 05246 05296 04530 04931 05065 05205 05116 04946(s1 c4) 05353 05354 05349 04915 05156 05218 04419 04861 04937 05095 05007 04795(s1 c5) 05323 05323 05317 04808 05076 05148 04315 04796 04817 04995 04905 04652(s2 c0) 05431 05434 05431 05219 05368 05403 04707 05036 05269 05374 05286 05189(s2 c1) 05395 05397 05393 05078 05266 05314 04573 04956 05115 05242 05154 05005(s2 c2) 05360 05361 05357 04960 05181 05237 04458 04886 04985 05134 05046 04853(s2 c3) 05331 05331 05326 04850 05100 05167 04352 04818 04864 05031 04945 04711(s2 c4) 05300 05300 05293 04743 05018 05093 04252 04752 04746 04931 04846 04572(s2 c5) 05273 05271 05266 04648 04946 05029 04159 04692 04639 04838 04755 04445(s3 c0) 05373 05374 05371 05019 05216 05265 04514 04917 05049 05186 05098 04932(s3 c1) 05341 05341 05336 04902 05128 05188 04399 04846 04917 05074 04990 04775(s3 c2) 05312 05312 05306 04798 05052 05122 04303 04782 04804 04977 04896 04644(s3 c3) 05281 05281 05275 04696 04976 05049 04206 04718 04689 04879 04799 04509(s3 c4) 05252 05251 05245 04598 04901 04984 04110 04657 04581 04785 04707 04378(s3 c5) 05226 05223 05218 04510 04833 04924 04023 04602 04481 04701 04621 04264(s4 c0) 05325 05325 05321 04860 05089 05150 04360 04816 04870 05030 04949 04723(s4 c1) 05294 05294 05289 04753 05010 05079 04258 04750 04752 04928 04849 04588(s4 c2) 05266 05265 05259 04653 04937 05013 04164 04690 04642 04838 04761 04458(s4 c3) 05238 05236 05230 04562 04864 04948 04073 04632 04541 04747 04672 04336(s4 c4) 05211 05208 05203 04475 04798 04891 03985 04577 04440 04662 04586 04218(s4 c5) 05186 05182 05176 04392 04733 04832 03901 04524 04348 04582 04509 04109

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 29 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the smallest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 5073 5175 and 5225 respectivelyWhile the ARR of other trading algorithms decrease bymore than 100 compared with those algorithms withouttransaction cost Therefore excessive transaction cost canlead to serious losses in the accounts For a general settingof s and c ie (s c) = (002 0003) ARR of MLP DBNand SAE decrease by 2741 2797 and 2825 respectivelywhile the ARR other algorithms decrease by more than 50and that of CART NB RF and XGB decrease by more than100 Therefore MLP DBN and SAE are more tolerant totransaction cost From single trading algorithm such as SAEif we do not consider slippage ie s=0 the average ARR ofSAE is 05040 under the transaction cost structure (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not consider

transparent transaction cost ie c=0 the averageARRof SAEis 04468 under the transaction cost structures (s1 c0) (s2c0) (s3 c0) (s4 c0) so transparent transaction cost hassmaller impact than slippage Through multiple comparativeanalysis the ARR under the transaction cost structures (s0c1) (s0 c2) (s0 c3) (s0 c1) (s1 c1) are not significantlydifferent from the ARR without transaction cost for MLPDBN and SAE the ARR under all other transaction coststructures are significantly smaller than the ARR withouttransaction cost For RNN LSTM GRU CART RF LR andSVM the ARR under the transaction cost structures (s0c1) (s0 c2) (s1 c0) are not significantly different fromthe ARR without transaction cost the ARR under all othertransaction cost structures are significantly smaller than theARR without transaction cost For NB and XGB the ARRunder the transaction cost structures (s0 c1) (s1 c0) arenot significantly different from the ARR without transactioncost the ARR under all other transaction cost structuresare significantly smaller than the ARR without transactioncost

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 15: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

Mathematical Problems in Engineering 15

Table 20 Multiple comparison analysis between the WR of any two trading algorithms The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 04117MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 00002 00006 00000LSTM 00000 00000 00000 00000 00000 09772GRU 00000 00000 00000 00000 00000 09911 10000CART 09931 00000 00000 00000 00000 00000 00000 00000NB 00031 00000 00001 00000 00000 00000 00000 00000 00000RF 00000 00000 00000 00000 00000 00205 06437 05358 00000 00000LR 00000 00000 00000 00000 00000 00010 01611 01105 00000 00000 10000SVM 00000 00000 00000 00000 00000 09914 10000 10000 00000 00000 05322 01090XGB 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000 00000

Table 21Multiple comparison analysis between theARRof any two trading strategiesThepvalue of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00007MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 04790 06355 07182LSTM 00000 00000 02512 03806 04630 10000GRU 00000 00000 02235 03454 04249 10000 10000CART 00000 00000 08301 09217 09542 10000 09999 09998NB 00000 00000 10000 10000 10000 02920 01295 01125 06517RF 00000 00000 00020 00048 00076 08705 09735 09806 05393 00006LR 00000 00000 02058 03222 03995 10000 10000 10000 09996 01019 09845SVM 00000 00000 10000 00803 01114 09993 10000 10000 09659 00165 09999 10000XGB 00000 00000 10000 00333 00484 09916 09997 09998 08789 00057 10000 09999 10000

between the AUC of all traditional ML algorithms TheAUC of all traditional ML algorithms except for CART aresignificantly greater than that of any DNN model There isno significant difference among the AUC ofMLP SAE DBNRNN and CART

(6)Through the hypothesis test analysis of H6a and H6bwe can obtain p valuelt22e-16Therefore there are significantdifferences between the WR of all trading algorithms There-fore we need to do further multiple comparative analysis andthe results are shown in Table 20 The number in the table isa p value of any two algorithms of Nemenyi test From Tables14 and 20 we can see that the WR of BAH and benchmarkindex have no significant difference but they are significantlysmaller than that of anyML algorithmTheWRofMLPDBNand SAE are significantly smaller than that of the other trad-ing algorithms but there is no significant difference betweenthe WR of MLP DBN and SAE The WR of LSTM andGRU have no significant difference but they are significantlysmaller than that of XGB and significantly greater than that of

CART and NB In traditional MLmodels the WR of NB andCART are significantly smaller than that of other algorithmsThe WR of XGB is significantly greater than that of all otherML algorithms

(7)Through the analysis of the hypothesis test of H7a andH7b we obtain p valuelt22e-16

Therefore there are significant differences between theARR of all trading strategies including the benchmark indexand BAH strategy Therefore we need to do further multiplecomparative analysis and the results are shown in Table 21FromTables 14 and 21 we can see that ARR of the benchmarkindex and BAH are significantly smaller than that of alltrading algorithms The ARR of MLP is significantly higherthan that of RF but there is no significant difference betweenMLP and other algorithms The ARR of SAE and DBN aresignificantly higher than that of RF and XGB but they arenot significantly different fromARR of other algorithms TheARR of NB is significantly higher than that of RF SVMand XGB But otherwise there is no significant difference

16 Mathematical Problems in Engineering

Table 22Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 08877MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 09099 08862 08114LSTM 00000 00000 03460 03080 02239 09999GRU 00000 00000 02132 01853 01270 09981 10000CART 00000 00000 00158 00195 00327 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000 00000 07298RF 00000 00000 10000 10000 10000 09968 07444 05789 00018 00000LR 00000 00000 01181 01003 00650 09879 10000 10000 00000 00000 04044SVM 00000 00000 10000 10000 10000 09849 05952 04238 00042 00000 10000 02704XGB 00000 00000 09937 09902 09746 10000 09878 09532 00001 00000 10000 08723 09998

Table 23 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00006DBN 00000 00004 10000SAE 00000 00023 10000 10000RNN 00000 00000 00320 00421 00111LSTM 00000 00000 00002 00003 00000 09947GRU 00000 00000 00001 00001 00000 09767 10000CART 00000 00000 01238 01538 00521 10000 09241 08305NB 00000 01875 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 01180 01469 00493 10000 09298 08401 10000 00000LR 00000 00000 00001 00002 00000 09881 10000 10000 08821 00000 08898SVM 00000 00000 03285 03839 01701 09999 07011 05424 10000 00000 10000 06216XGB 00000 00000 00308 00405 00106 10000 09951 09783 10000 00000 10000 09890 09998

between any other two algorithms Therefore the ARR ofmost traditional ML models are not significantly worse thanthat of the best DNNmodel

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore There are significantdifferences betweenASRof all trading strategies including thebenchmark index and BAH strategy The results of multiplecomparative analysis are shown in Table 22 From Tables 14and 22 we can see that the ASR of the benchmark indexand BAH are significantly smaller than that of all tradingalgorithms The ASR of all ML algorithms are significantlyhigher than that of CART and NB but there is no significantdifference between the ASR of CART and NB Beyond thatthere is no significant difference between any other twoalgorithms Therefore the ASR of all traditional ML modelsexcept NB and CART are not significantly worse than that ofany DNNmodel

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between the MDD of these trading strategies

including the benchmark index and the BAH strategyThe results of multiple comparative analysis are shown inTable 23 From Tables 14 and 23 we can see that the MDDof the benchmark index is significantly smaller than that ofother trading strategies including BAH strategy TheMDD ofBAH is significantly greater than that of all trading algorithmsexcept NBTheMDDofMLPDBN and SAE are significantlylower than that of NB but significantly higher than thatof RNN LSTM GRU LR and XGB The MDD of NB issignificantly greater than that of all other trading algorithmsBeyond that there is no significant difference between anyother two algorithms Therefore all ML algorithms expectNB especially LSTM RNN GRU LR and XGB can play arole in controlling trading risk

In a word some DNN models such as MLP DBN andSAE have good performance in AR PR and F1 traditionalML algorithms such as LR and XGB have good performanceinAUCandWRTheARRof some traditionalML algorithmssuch as CART NB LR and SVM are not significantlydifferent from that of the six DNN models The ASR of the

Mathematical Problems in Engineering 17

six DNN algorithms are not significantly different from alltraditional ML models except NB and CART The MDD ofLR and XGB are significantly smaller than those of MLPDBN and SAE and are not significantly different fromthat of LSTM GRU and RNN The ARR and ASR of allML algorithms are significantly greater than those of BAHand benchmark index the MDD of all ML algorithms aresignificantly smaller than that of the benchmark index butsignificantly greater than that of BAH strategy

From the above analysis and evaluation we can see thatthe directional evaluation indicators of some DNN modelsare very competitive in CSICS while the indicators of sometraditional ML algorithms have excellent performance inSPICS Whether in SPICS or CSICS the ARR and ASR ofall ML algorithms are significantly greater than that of thebenchmark index and BAH strategy respectively In all MLalgorithms there are always some traditional ML algorithmswhich are not significantly worse than the best DNN modelfor any performance evaluation indicator (ARR ASR andMDD)Therefore if we do not consider transaction cost andother factors affecting trading performance of DNN modelsare alternative but not the best choice when they are appliedto stock trading

In the same period the ARR of any ML algorithm inCSICS is significantly greater than that of the same algorithmin SPICS (p valuelt0001 in theNemenyi test)Meanwhile theMDD of any ML algorithm in CSICS is significantly greaterthan that of the same algorithm in SPICS (p value lt0001in the Nemenyi test) The results show that the quantitativetrading algorithms can more easily obtain excess returns inthe Chinese A-share market but the volatility risk of tradingin Chinese A-share market is significantly higher than that ofthe US stock market in the past 8 years

6 The Impact of Transaction Cost onPerformance of ML Algorithms

Trading cost can affect the profitability of a stock tradingstrategy Transaction cost that can be ignored in long-termstrategies is significantly magnified in daily trading Howevermany algorithmic trading studies assume that transactioncost does not exist ([10 17] etc) In practice frictions suchas transaction cost can distort the market from the perfectmodel in textbooks The cost known prior to trading activityis referred to as transparent such as commissions exchangefees and taxes The costs that has to be estimated are knownas implicit including comprise bid-ask spread latency orslippage and related market impact This section focuses onthe transparent and implicit cost and how do they affecttrading performance in daily trading

61 Experimental Settings and Backtesting Algorithm In thispart the transparent transaction cost is calculated by a certainpercentage of transaction turnover for convenience theimplicit transaction cost is very complicated in calculationand it is necessary to make a reasonable estimate for therandom changes of market environment and stock pricesTherefore we only discuss the impact of slippage on tradingperformance

The transaction cost structures of American stocks aresimilar to that of Chinese A-shares We assume that transpar-ent transaction cost is calculated by a percentage of turnoversuch as less than 05 [40 41] and 02 and 05 in theliterature [42] It is different for the estimation of slippage

In some quantitative trading simulation software such asJoinQuant [43] and Abuquant [44] the slippage is set to 002The transparent transaction cost and implicit transaction costare charged in both directions when buying and selling Itis worth noting that the transparent transaction cost varieswith the different brokers while the implicit transaction costis related to market liquidity market information networkstatus trading software etc

We set slippages s = s0=0 s1=001 s2=002 s3=003s4=004 the transparent transaction cost c = c0=0 c1=0001c2=0002 c3=0003 c4=0004 c5=0005 For different s ccombinations we study the impact of different transactioncost structures on trading performance We assume thatbuying and selling positions are one unit so the turnover isthe corresponding stock price When buying stocks we notonly need to pay a certain percentage cost of the purchaseprice but also need to pay an uncertain slippage cost Thatis we need to pay a higher price than the real-time price119875119905minus1

when we are buying But when selling stocks we notonly need to pay a certain percentage cost of the sellingprice but also to pay an uncertain slippage cost Generallyspeaking we need to sell at a price lower than the real-timeprice 119875

119905 It is worth noting that our trading strategy is self-

financing If ML algorithms predict the continuous occur-rence of buying signals or selling signals ie |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 0 we will continue to hold or do nothingso the transaction cost at this time is 0 when |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 1 it is indicated that the position maybe changed from holding to selling or from empty positionto buying At this time we would pay transaction costdue to the trading operation Finally we get a real yieldis

119877119890119905119905le119862119897119900119904119890119875119903119894119888119890

119905minus 119862119897119900119904119890119875119903119894119888119890

119905minus1

119862119897119900119904119890119875119903119894119888119890119905minus1

119875119905= 119862119897119900119904119890119875119903119894119888119890

119905

lowast (1 minus 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816)

minus 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816

119875119905minus1

= 119862119897119900119904119890119875119903119894119888119890119905minus1

lowast (1 + 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816)

+ 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816

119877119890119905119905=119875119905minus 119875119905minus1

119875119905minus1

(5)

where 119862119897119900119904119890119875119903119894119888119890119905

denotes the 119905-th closing price119879119903119886119889119890119878119894119892119899119886119897

119905denotes the 119905-th trading signal 119875

119905denotes

the 119905-th executing price and 119877119890119905119905denotes the 119905-th return rate

We propose a backtesting algorithm with transaction costbased on the above analysis as is shown in Algorithm 3

18 Mathematical Problems in Engineering

Input TS TS is trading signals of a stocks s is slippagec c is transparent transaction cost

Output WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) WR=NULL ARR=NULL ASR=NULL MDD=NULL(3) for (i in 1 N) (4) Stock Data=Stock Code List[i](5) ClosePricet=Stock Data [ldquoClosing Pricerdquo](6) Pt =ClosePricet lowast(1-clowastabs(TSt-TSt-1)) - slowastabs(TSt-TSt-1)(7) Pt-1 =ClosePricetlowast(1+clowastabs(TSt-TSt-1)) + slowastabs(TSt-TSt-1)(8) Rett= (Pt- Pt-1) Pt Ret is the return rate series(9) TDRR=lag (TS)lowastRet TDRR is the daily return through trading(10) WR[i]=sum (TDRRgt0)sum(TDRR =0)(11) ARR[i]=Returnannualized (TDRR)(12) ASR[i]=SharpeRatioannualized (TDRR)(13) MDD[i]=maxDrawDown (TDRR)(14) WR=c (WR WR[i])(15) ARR=c (ARR ARR[i])(16) ASR=c (ASR ASR[i])(17) MDD=c (MDD MDD[i])(18) (19) return (WR ARR ASR MDD)

Algorithm 3 Backtesting algorithm with transaction cost in R language

62 Analysis of Impact of Transaction Cost on the TradingPerformance of SPICS Transaction cost is one of the mostimportant factors affecting trading performance In US stocktrading transparent transaction cost can be charged accord-ing to a fixed fee per order or month or a floating fee basedon the volume and turnover of each transaction Sometimescustomers can also negotiate with broker to determinetransaction cost The transaction cost charged by differentbrokers varies greatly Meanwhile implicit transaction costis not known beforehand and the estimations of them arevery complex Therefore we assume that the percentageof turnover is the transparent transaction cost for ease ofcalculation In the aspect of implicit transaction cost we onlyconsider the impact of slippage on trading performance

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 24 WR is decreasing with the increase oftransaction cost for any trading algorithm which is intuitiveWhen the transaction cost is set to (s c) = (004 0005) theWR of each algorithm is the lowest Compared with setting(s c) = (0 0) the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR and SVM to XGB are reduced by580 597 591 1583 1804 1395 2171 16042216 1854 1850 and 2597 respectively ThereforeMLP DBN and SAE are more tolerant to transaction costGenerally speaking the DNN models have stronger capacityto accommodate transaction cost than the traditional MLmodels From the single trading algorithm such as MLP ifwe do not consider slippage ie s=0 the average WR ofMLP is 05510 under transaction cost structures (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not considertransparent transaction cost ie c=0 the averageWRofMLP

is 05618 under transaction cost structures (s1 c0) (s2 c0)(s3 c0) (s4 c0) so transparent transaction cost has greaterimpact than slippageThroughmultiple comparative analysisthe WR under the transaction cost structure (s1 c0) is notsignificantly different from the WR without transaction costfor MLP DBN and SAETheWR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the WR under the transaction cost structure (s1 c0) (s2 c0) are not significantly different from theWRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 25 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the lowest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 4031 4157 and 4093 respectivelywhile the ARR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin accounts For a general setting of s and c ie (s c) = (0020003) ARR of MLP DBN and SAE decrease by 23262400 and 2361 respectively while the ARR of otheralgorithms decrease by more than 50 and that of CARTand XGB decrease bymore than 100ThereforeMLP DBNand SAE are more tolerant to high transaction cost Fromsingle trading algorithm such as RNN if we do not considerslippage ie s=0 the average ARR of RNN is 01434 under

Mathematical Problems in Engineering 19

Table24Th

eWRof

SPICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

05676

05680

05683

05843

05825

05844

05266

05930

05912

05859

05831

05891

(s0c1)

05615

05618

05621

05669

05626

05694

05052

05752

05663

05654

05630

05599

(s0c2)

05560

05560

05564

05507

05442

05553

04847

05585

05429

05463

05438

05324

(s0c3)

05507

05506

05510

05353

05269

05418

04652

05424

05205

05278

05253

05061

(s0c4)

05457

05454

05460

05206

05101

05289

044

7005277

04996

05105

05084

04818

(s0c5)

05410

05407

05412

05071

04946

05170

04303

05138

04803

04947

04924

04594

(s1c0)

056

49056

53056

5605778

05751

05785

05190

058

61058

2405782

05759

05788

(s1c1)

05594

05597

05600

05619

05571

05648

04991

05700

05597

05595

05574

05521

(s1c2)

05539

05539

05544

05458

05389

05508

04788

05534

05364

05406

05383

05249

(s1c3)

05487

05486

05491

05305

05215

05375

04597

05375

05141

05223

05200

04988

(s1c4)

05438

05436

05441

05163

05052

05249

044

1805231

04938

05054

05034

04750

(s1c5)

05394

05390

05396

05032

04902

05132

04255

05097

04751

04900

04880

04532

(s2c0)

05628

05631

05635

05729

056

9705741

05134

058

1105758

05726

05704

05713

(s2c1)

05573

05574

05578

05568

05515

05602

04931

05647

05527

05535

05515

05442

(s2c2)

05518

05518

05523

05408

05336

05463

04729

05482

05297

05349

05326

05172

(s2c3)

05469

05467

05472

05260

05164

05334

04543

05330

05082

05171

05150

04918

(s2c4)

05421

05417

05423

05120

05004

05209

04368

05187

04881

05004

04986

046

85(s2c5)

05377

05373

05379

04993

04858

05096

04209

05055

04699

04855

04835

044

73(s3c0)

05606

05609

05612

05678

05640

05694

05074

05759

05690

05668

05646

05635

(s3c1)

05552

05553

05558

05518

05460

05556

04872

05595

05460

05478

05459

05365

(s3c2)

05499

05498

05503

05362

05284

05422

046

7505434

05233

05295

05273

05099

(s3c3)

05450

05448

05453

05216

05114

05292

04491

05284

05020

05120

05098

04849

(s3c4)

05405

05401

05407

05080

04960

05172

04321

05146

04827

04959

04940

04622

(s3c5)

05362

05357

05363

04955

04816

05063

04166

05017

04651

04815

04793

044

17(s4c0)

05587

05589

05593

05630

05588

05652

05019

05710

05627

05613

05593

05562

(s4c1)

05533

05533

05537

05470

05407

05513

04815

05544

05395

05424

05404

05290

(s4c2)

05480

05479

05484

05316

05232

05380

04620

05386

05171

05242

05220

05026

(s4c3)

05432

05429

05435

05172

05067

05253

044

4005241

04964

05070

05051

04782

(s4c4)

05388

05384

05391

05041

04917

05137

04274

05106

04775

04914

04897

04564

(s4c5)

05347

05341

05347

04918

04774

05029

04123

04979

046

0204773

04752

04361

20 Mathematical Problems in Engineering

Table25Th

eARR

ofSP

ICSford

ailytradingwith

different

transactioncost

Ther

esultthatthere

isno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

03332

03296

03325

02943

02920

02934

03317

02975

03133

02942

03067

03041

(s0c1)

03128

030

8703118

02439

02327

02521

02266

02496

02384

02336

02400

02137

(s0c2)

02924

02879

02912

01936

01735

02108

01216

02017

01636

01731

01734

01234

(s0c3)

02721

02672

02706

01433

0114

301697

00168

01539

00889

01126

01070

00333

(s0c4)

02519

02464

02500

00931

00553

01285

-00878

01062

00143

00522

004

06-00567

(s0c5)

02316

02257

02294

00430

-00037

00875

-019

2400586

-00602

-0008

-00257

-014

66(s1c0)

03249

03212

03242

027

7802729

02794

029

53028

18028

9802747

028

5502762

(s1c1)

03046

03004

03035

02274

02136

02381

01902

02339

02149

02141

02188

01859

(s1c2)

02842

02796

02829

01771

01544

01969

00853

01861

01401

01536

01523

00957

(s1c3)

02639

02588

02623

01269

00953

01557

-00195

01383

00654

00931

00858

000

56(s1c4)

02437

02381

02417

00767

00363

0114

6-012

41009

06-00091

00328

00195

-00844

(s1c5)

02234

02174

02211

00266

-00226

00735

-02285

00430

-00836

-00275

-0046

8-01742

(s2c0)

03167

03129

03159

026

1302538

026

54025

89026

61026

6302551

026

43024

84(s2c1)

02964

02921

02952

02110

01946

02241

01539

02182

01914

01946

01977

01581

(s2c2)

0276

02713

02746

01607

01354

01829

00490

01704

0116

701341

01312

006

79(s2c3)

02557

02505

02540

0110

400763

01418

-00557

01227

004

2000737

006

47-00221

(s2c4)

02355

02298

02334

006

0300173

01007

-016

0300750

-00325

00134

-00016

-01120

(s2c5)

02153

02091

02129

00102

-00416

00597

-0264

700274

-010

69-00469

-00678

-02018

(s3c0)

030

85030

46030

7602448

02348

02514

02225

02504

02428

02356

02431

02206

(s3c1)

02881

02838

02869

01945

01756

02102

0117

502026

01680

01751

01765

01304

(s3c2)

02678

02630

02663

01442

01164

01690

00127

01548

00933

0114

601100

004

02(s3c3)

02476

02422

02457

00940

00574

01279

-00919

01071

00187

00543

00436

-00498

(s3c4)

02273

02215

02252

00439

-00016

00868

-019

6400595

-00558

-0006

-00227

-013

97(s3c5)

02071

02008

02047

-00062

-0060

5004

58-0300

800119

-013

02-00662

-00889

-02294

(s4c0)

03003

02962

02993

02284

02157

02374

01862

02348

02193

02161

02219

01929

(s4c1)

02799

02754

02786

01781

01565

01962

00813

01870

01445

01556

01554

01026

(s4c2)

02597

02547

02580

01278

00974

01551

-00235

01392

00699

00952

00889

00125

(s4c3)

02394

02339

02375

00776

00384

0114

0-012

8100915

-0004

700349

00226

-00774

(s4c4)

02192

02132

02169

00275

-00205

00729

-02326

00439

-00792

-00254

-00437

-016

73(s4c5)

01989

01926

01964

-00225

-00794

00319

-033

69-00037

-015

35-00856

-010

99-02570

Mathematical Problems in Engineering 21

the transaction cost structures (s0 c1) (s0 c2) (s0 c3) (s0c4) (s0 c5) if we do not consider transparent transactioncost ie c=0 the average ARR of RNN is 02531 under thetransaction cost structure (s1 c0) (s2 c0) (s3 c0) (s4c0) so transparent transaction cost has greater impact thanslippage Through multiple comparative analysis the ARRunder the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s0 c1) are not significantly different from the ARRwithout transaction cost for MLP DBN and SAE the ARRunder all other transaction cost structures are significantlysmaller than theARRwithout transaction cost For all tradingalgorithms except for MLP DBN and SAE the ARR underthe transaction cost structures (s1 c0) (s2 c0) are notsignificantly different from the ARR without transactioncost the ARR under all other transaction cost structures aresignificantly smaller than the ARR without transaction cost

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 26 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theASR of each algorithm is the lowest Compared with settingwithout transaction cost the ASR of MLP DBN and SAEreduce by 3997 4123 and 4066 respectively while theASR of other trading algorithms reduce by more than 90compared with the case of no transaction cost Thereforeexcessive transaction cost will significantly reduce ASR Fora general setting of s and c ie (s c) = (002 0003) theASR of MLP DBN and SAE decrease by 2262 2336and 2302 respectively while the ASR of other algorithmsdecrease by more than 50 the ASR of CART and XGBdecrease by more than 100Therefore MLP DBN and SAEare more tolerant to transaction cost From single tradingalgorithm such as NB if we do not consider slippage ies=0 the average ASR of NB is 08052 under the transactioncost structure (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5)if we do not consider transparent transaction cost ie c=0the average ASR of NB is 14182 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has greater impact than slippage Throughmultiple comparative analysis the ASR under the transactioncost structures (s1 c0) (s2 c0) (s3 c0) (s0 c1) are notsignificantly different from the ASR without transaction costfor MLP DBN and SAE the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the ASR under the transaction cost structures(s1 c0) (s2 c0) are not significantly different from the ASRwithout transaction cost the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 27 MDD increases with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the settings without transaction cost theMDD of MLP DBN and SAE increase by 932 1108 and

1032 respectively The MDD of other trading algorithmsincrease by more than 80 compared with those withoutconsidering transaction costTherefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 483 580 and 533respectively while the MDD of other algorithms increase bymore than 35 and theMDDofCART RF andXGB increasebymore than 100Therefore MLP DBN and SAE are moretolerant to transaction cost As awhole theDNNmodels havestronger capacity to accommodate transaction cost than thetraditional ML models From single trading algorithm suchas GRU if we do not consider slippage ie s=0 the averageMDD of GRU is 04459 under the transaction cost structures(s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do notconsider transparent transaction cost ie c=0 the averageMDD of GRU is 03559 under the transaction cost structures(s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparent transactioncost has greater impact than slippage Through multiplecomparative analysis the MDD under any the transactioncost structure is not significantly different from the MDDwithout transaction cost for MLP DBN and SAE For alltrading algorithms except for MLP DBN and SAE such asLR the MDD under the transaction cost structures (s0 c1)(s1 c0) (s2 c0) (s3 c0) are not significantly different fromthe MDD without transaction cost the MDD under all othertransaction cost structures are significantly greater than theMDD without transaction cost

Through the analysis of the Table 27 performance eval-uation indicators we find that trading performance afterconsidering transaction cost will be worse than that withoutconsidering transaction cost as is in actual trading situationIt is noteworthy that the performance changes of DNNalgorithms especially MLP DBN and SAE are very smallafter considering transaction cost This shows that the threealgorithms have good tolerance to changes of transactioncost Especially for the MDD of the three algorithms thereis no significant difference with that with no transactioncost So we can consider applying them in actual tradingMeanwhile we conclude that the transparent transactioncost has greater impact on the trading performances thanthe slippage for SPICS This is because the prices of SPICSare too high when the transparent transaction cost is setto a certain percentage of turnover In actual transactionsspecial attention needs to be paid to the fact that the trans-action performance under most transaction cost structuresis significantly lower than the trading performance withoutconsidering transaction cost It is worth noting that theperformance of traditional ML algorithm is not worse thanthat ofDNNalgorithmswithout considering transaction costwhile the performance of DNN algorithms is better than thatof traditional ML algorithms after considering transactioncost

63 Analysis of Impact of Transaction Cost on the TradingPerformance of CSICS Similar to Section 62 we will discussthe impact of transaction cost on trading performance ofCSICS in the followings In the Chinese A-share marketthe transparent transaction cost is usually set to a certain

22 Mathematical Problems in Engineering

Table26Th

eASR

ofSP

ICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

1546

815

412

15502

15764

15571

15828

13927

16237

16763

15818

16018

16298

(s0c1)

1456

214

478

14577

1300

012

317

13565

09346

13554

12650

12472

12456

11294

(s0c2)

13639

13527

13635

10191

09015

11262

04657

10822

08482

09074

08846

06236

(s0c3)

12702

12561

12679

07355

05690

08929

-00085

08061

04298

05652

05216

0118

2(s0c4)

11751

11581

11709

04511

02366

06580

-04823

05291

00139

02234

01596

-03812

(s0c5)

1079

10591

10728

01678

-00931

04227

-09500

02534

-039

59-01152

-019

87-08696

(s1c0)

15121

1505

715

149

1492

714

606

15119

1244

915

424

1558

214

825

14974

1488

6(s1c1)

14208

14116

14217

12146

11334

12841

07823

12722

1144

711459

11394

09859

(s1c2)

13279

13159

13270

09325

08020

10526

03105

09977

07267

08048

07772

04792

(s1c3)

12337

12188

12308

064

8204690

08185

-016

4607209

03082

04622

04139

-00257

(s1c4)

11382

11204

11333

03637

01368

05831

-06374

04438

-010

6801208

00524

-052

31(s1c5)

10417

10210

10348

00807

-019

2003478

-110

2501686

-05146

-02169

-0304

7-10083

(s2c0)

1477

1469

914

792

1408

113

632

1440

310

946

1460

114

390

1382

213

922

1346

2(s2c1)

13851

13752

13854

11285

10343

12111

06283

11883

10237

10439

10325

08416

(s2c2)

12916

12789

12901

08454

07021

09785

01547

09128

060

4907019

06696

03346

(s2c3)

11969

11812

11934

05607

03688

07437

-032

0506355

01868

03591

03063

-016

90(s2c4)

11010

10825

10955

02763

00372

05081

-07916

03586

-02268

00183

-00545

-06639

(s2c5)

1004

109827

09967

-0006

-02905

02729

-12533

00841

-06323

-031

79-04101

-114

54(s3c0)

14415

14337

14432

13227

12650

13679

09425

13770

13189

12810

12862

12030

(s3c1)

13490

13384

13488

10419

09348

11375

04733

11039

09023

09413

09252

06971

(s3c2)

12551

12416

12529

07580

060

19090

40-00013

08275

04832

05988

05618

01904

(s3c3)

11599

11435

11558

04731

02688

066

88-04757

05500

00658

02562

01988

-031

16(s3c4)

10636

10443

10575

01891

-00620

04331

-0944

202735

-0346

0-00836

-016

08-08034

(s3c5)

09664

09443

09584

-00924

-03883

01982

-14018

000

00-074

89-04183

-05146

-12808

(s4c0)

14058

13972

1406

812

368

11662

12950

07892

12933

11983

11793

11796

10591

(s4c1)

13127

13013

13119

09549

08350

10634

03180

10190

07807

08386

08177

05527

(s4c2)

12183

1204

12155

06705

05018

08293

-015

6807421

03617

04958

04542

004

68(s4c3)

11226

11055

11179

03857

01691

05938

-06295

046

47-00545

01537

00918

-04529

(s4c4)

1026

1006

10193

01021

-016

0703582

-10948

01888

-0464

2-018

49-02665

-09413

(s4c5)

09286

09057

09199

-017

83-04853

01238

-15478

-00836

-0864

2-05177

-06182

-14142

Mathematical Problems in Engineering 23

Table 27 The MDD of SPICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 03583 03584 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338(s0 c1) 03629 03638 03594 03779 03986 03636 04072 03712 03843 03963 03972 04203(s0 c2) 03677 03695 03647 04302 04707 03968 05168 04127 04842 04729 04787 05735(s0 c3) 03727 03756 03703 04990 05639 04376 06564 04709 06172 05682 05844 07335(s0 c4) 03781 03821 03764 05767 06612 04873 07804 05424 07377 06653 06913 08447(s0 c5) 03839 03890 03828 06529 0746 05444 08730 06162 08272 07501 07808 09118(s1 c0) 03596 03600 03560 03500 036130 03446 03574 03502 03414 03585 03569 03540(s1 c1) 03642 03655 03609 03907 04156 03717 04320 03814 04067 04154 04170 04541(s1 c2) 03691 03712 03662 04466 04936 04066 05534 04270 05172 04971 05049 06168(s1 c3) 03742 03774 03720 05183 05895 04495 06928 04885 06499 05937 06129 07662(s1 c4) 03796 03839 03781 05961 06842 05013 08105 05610 07631 06884 07161 08649(s1 c5) 03856 03909 03847 0671 07646 05595 08946 06342 08451 07691 0800 09235(s2 c0) 03609 03615 03573 03607 03756 03517 03770 03586 03586 03739 03727 03787(s2 c1) 03656 03671 03623 04047 04349 03805 04627 03929 04339 04365 04397 04929(s2 c2) 03705 03729 03678 04642 05176 04171 05916 04424 05504 05218 05327 06577(s2 c3) 03756 03792 03736 05377 06143 04624 07277 05067 06805 06183 06402 07939(s2 c4) 03812 03859 03799 06155 07056 05161 08380 05796 07856 07099 07388 08816(s2 c5) 03873 03930 03866 06887 07816 05751 09126 06517 08606 07864 08172 09331(s3 c0) 03622 03631 03588 03729 03912 03594 04004 03685 03795 03909 03909 04081(s3 c1) 03669 03687 03639 04200 04555 03901 04966 04062 04622 04587 04642 05334(s3 c2) 03719 03746 03694 04826 05423 04286 06295 04589 05833 05465 05607 06936(s3 c3) 03772 03811 03754 05572 06377 04762 07609 05248 07081 06420 06657 08175(s3 c4) 03829 03879 03818 06341 07254 05314 08620 05980 08054 07300 07593 08956(s3 c5) 03894 03954 03888 07056 07972 05909 09275 06689 08740 08022 08325 09412(s4 c0) 03635 03647 03602 03861 04082 03678 04274 03798 04015 04096 04114 04396(s4 c1) 03683 03704 03654 04362 04774 04005 05325 04211 04908 04814 04894 05730(s4 c2) 03734 03765 03712 05013 05664 04410 06667 04758 06142 05707 05875 07253(s4 c3) 03790 03833 03775 05765 06600 04905 07906 05429 07330 06644 06894 08375(s4 c4) 03851 03904 03841 06521 07439 05470 08824 06162 08230 07485 07782 09074(s4 c5) 03917 03981 03913 07218 08115 06067 09395 06857 08858 08165 08463 09480

percentage of turnover and it is the same as the assumptionin the experimental settings As in the US stock market thesmallest unit of price change is 001 (one tick) It is reasonableto set slippage to be 001-005 Of course it should be notedthat the prices fluctuation may be more intense when closingthan that in the middle of a trading day

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 28 the WR is decreasing with the increaseof transaction cost for any trading algorithm When thetransaction cost is set to (s c) = (004 0005) the WR of eachalgorithm is the smallest Comparedwith the settings withouttransaction cost the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR SVM and XGB are reduced by671 688 697 2269 1726 1548 2430 14912484 2112 2112 and 2919 respectively For a generalsetting of s and c ie (s c) = (002 0003) the WR ofMLP DBN and SAE decrease by 410 420 and 430respectively while the WR of other algorithms decrease bymore than 9 the WR of CART RF and XGB decrease by

more than 15 Therefore MLP DBN and SAE are moretolerant to transaction cost From single trading algorithmsuch as LSTM if we do not consider slippage ie s=0 theaverage WR of DBN is 05417 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage WR of LSTM is 05304 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the WR under the transactioncost structures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the WR without transaction cost for MLPDBN SAE and NB the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN SAE and NB the WR under the transaction coststructure (s0 c1) is not significantly different from the WRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

24 Mathematical Problems in Engineering

Table 28 The WR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803(s0 c1) 05523 05527 05525 05525 05608 05620 05009 05227 05612 05665 05571 05595(s0 c2) 05488 05492 05489 05389 05512 05535 04879 05149 05460 05542 05445 05411(s0 c3) 05453 05456 05452 05258 05414 05451 04747 05068 05313 05418 05320 05234(s0 c4) 05417 05419 05414 05127 05320 05368 04622 04991 05172 05297 05202 05067(s0 c5) 05383 05383 05379 05004 05230 05286 04504 04917 05036 05180 05088 04905(s1 c0) 05494 05499 05497 05444 05541 05558 04925 05170 05520 05584 05492 05488(s1 c1) 05456 05459 05456 05286 05424 05456 04775 05080 05342 05437 05345 05275(s1 c2) 05421 05423 05420 05161 05335 05377 04654 05007 05207 05320 05231 05110(s1 c3) 05386 05388 05383 05036 05246 05296 04530 04931 05065 05205 05116 04946(s1 c4) 05353 05354 05349 04915 05156 05218 04419 04861 04937 05095 05007 04795(s1 c5) 05323 05323 05317 04808 05076 05148 04315 04796 04817 04995 04905 04652(s2 c0) 05431 05434 05431 05219 05368 05403 04707 05036 05269 05374 05286 05189(s2 c1) 05395 05397 05393 05078 05266 05314 04573 04956 05115 05242 05154 05005(s2 c2) 05360 05361 05357 04960 05181 05237 04458 04886 04985 05134 05046 04853(s2 c3) 05331 05331 05326 04850 05100 05167 04352 04818 04864 05031 04945 04711(s2 c4) 05300 05300 05293 04743 05018 05093 04252 04752 04746 04931 04846 04572(s2 c5) 05273 05271 05266 04648 04946 05029 04159 04692 04639 04838 04755 04445(s3 c0) 05373 05374 05371 05019 05216 05265 04514 04917 05049 05186 05098 04932(s3 c1) 05341 05341 05336 04902 05128 05188 04399 04846 04917 05074 04990 04775(s3 c2) 05312 05312 05306 04798 05052 05122 04303 04782 04804 04977 04896 04644(s3 c3) 05281 05281 05275 04696 04976 05049 04206 04718 04689 04879 04799 04509(s3 c4) 05252 05251 05245 04598 04901 04984 04110 04657 04581 04785 04707 04378(s3 c5) 05226 05223 05218 04510 04833 04924 04023 04602 04481 04701 04621 04264(s4 c0) 05325 05325 05321 04860 05089 05150 04360 04816 04870 05030 04949 04723(s4 c1) 05294 05294 05289 04753 05010 05079 04258 04750 04752 04928 04849 04588(s4 c2) 05266 05265 05259 04653 04937 05013 04164 04690 04642 04838 04761 04458(s4 c3) 05238 05236 05230 04562 04864 04948 04073 04632 04541 04747 04672 04336(s4 c4) 05211 05208 05203 04475 04798 04891 03985 04577 04440 04662 04586 04218(s4 c5) 05186 05182 05176 04392 04733 04832 03901 04524 04348 04582 04509 04109

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 29 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the smallest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 5073 5175 and 5225 respectivelyWhile the ARR of other trading algorithms decrease bymore than 100 compared with those algorithms withouttransaction cost Therefore excessive transaction cost canlead to serious losses in the accounts For a general settingof s and c ie (s c) = (002 0003) ARR of MLP DBNand SAE decrease by 2741 2797 and 2825 respectivelywhile the ARR other algorithms decrease by more than 50and that of CART NB RF and XGB decrease by more than100 Therefore MLP DBN and SAE are more tolerant totransaction cost From single trading algorithm such as SAEif we do not consider slippage ie s=0 the average ARR ofSAE is 05040 under the transaction cost structure (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not consider

transparent transaction cost ie c=0 the averageARRof SAEis 04468 under the transaction cost structures (s1 c0) (s2c0) (s3 c0) (s4 c0) so transparent transaction cost hassmaller impact than slippage Through multiple comparativeanalysis the ARR under the transaction cost structures (s0c1) (s0 c2) (s0 c3) (s0 c1) (s1 c1) are not significantlydifferent from the ARR without transaction cost for MLPDBN and SAE the ARR under all other transaction coststructures are significantly smaller than the ARR withouttransaction cost For RNN LSTM GRU CART RF LR andSVM the ARR under the transaction cost structures (s0c1) (s0 c2) (s1 c0) are not significantly different fromthe ARR without transaction cost the ARR under all othertransaction cost structures are significantly smaller than theARR without transaction cost For NB and XGB the ARRunder the transaction cost structures (s0 c1) (s1 c0) arenot significantly different from the ARR without transactioncost the ARR under all other transaction cost structuresare significantly smaller than the ARR without transactioncost

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 16: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

16 Mathematical Problems in Engineering

Table 22Multiple comparison analysis between theASRof any two trading strategiesThe p value of the two trading strategieswith significantdifference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 08877MLP 00000 00000DBN 00000 00000 10000SAE 00000 00000 10000 10000RNN 00000 00000 09099 08862 08114LSTM 00000 00000 03460 03080 02239 09999GRU 00000 00000 02132 01853 01270 09981 10000CART 00000 00000 00158 00195 00327 00000 00000 00000NB 00000 00000 00000 00000 00000 00000 00000 00000 07298RF 00000 00000 10000 10000 10000 09968 07444 05789 00018 00000LR 00000 00000 01181 01003 00650 09879 10000 10000 00000 00000 04044SVM 00000 00000 10000 10000 10000 09849 05952 04238 00042 00000 10000 02704XGB 00000 00000 09937 09902 09746 10000 09878 09532 00001 00000 10000 08723 09998

Table 23 Multiple comparison analysis between the MDD of any two trading strategies The p value of the two trading strategies withsignificant difference is in boldface

Index BAH MLP DBN SAE RNN LSTM GRU CART NB RF LR SVMBAH 00000MLP 00000 00006DBN 00000 00004 10000SAE 00000 00023 10000 10000RNN 00000 00000 00320 00421 00111LSTM 00000 00000 00002 00003 00000 09947GRU 00000 00000 00001 00001 00000 09767 10000CART 00000 00000 01238 01538 00521 10000 09241 08305NB 00000 01875 00000 00000 00000 00000 00000 00000 00000RF 00000 00000 01180 01469 00493 10000 09298 08401 10000 00000LR 00000 00000 00001 00002 00000 09881 10000 10000 08821 00000 08898SVM 00000 00000 03285 03839 01701 09999 07011 05424 10000 00000 10000 06216XGB 00000 00000 00308 00405 00106 10000 09951 09783 10000 00000 10000 09890 09998

between any other two algorithms Therefore the ARR ofmost traditional ML models are not significantly worse thanthat of the best DNNmodel

(8) Through the hypothesis test analysis of H8a and H8bwe obtain p valuelt22e-16 Therefore There are significantdifferences betweenASRof all trading strategies including thebenchmark index and BAH strategy The results of multiplecomparative analysis are shown in Table 22 From Tables 14and 22 we can see that the ASR of the benchmark indexand BAH are significantly smaller than that of all tradingalgorithms The ASR of all ML algorithms are significantlyhigher than that of CART and NB but there is no significantdifference between the ASR of CART and NB Beyond thatthere is no significant difference between any other twoalgorithms Therefore the ASR of all traditional ML modelsexcept NB and CART are not significantly worse than that ofany DNNmodel

(9)Through the hypothesis test analysis of H9a and H9bwe obtain p valuelt22e-16 Therefore there are significantdifferences between the MDD of these trading strategies

including the benchmark index and the BAH strategyThe results of multiple comparative analysis are shown inTable 23 From Tables 14 and 23 we can see that the MDDof the benchmark index is significantly smaller than that ofother trading strategies including BAH strategy TheMDD ofBAH is significantly greater than that of all trading algorithmsexcept NBTheMDDofMLPDBN and SAE are significantlylower than that of NB but significantly higher than thatof RNN LSTM GRU LR and XGB The MDD of NB issignificantly greater than that of all other trading algorithmsBeyond that there is no significant difference between anyother two algorithms Therefore all ML algorithms expectNB especially LSTM RNN GRU LR and XGB can play arole in controlling trading risk

In a word some DNN models such as MLP DBN andSAE have good performance in AR PR and F1 traditionalML algorithms such as LR and XGB have good performanceinAUCandWRTheARRof some traditionalML algorithmssuch as CART NB LR and SVM are not significantlydifferent from that of the six DNN models The ASR of the

Mathematical Problems in Engineering 17

six DNN algorithms are not significantly different from alltraditional ML models except NB and CART The MDD ofLR and XGB are significantly smaller than those of MLPDBN and SAE and are not significantly different fromthat of LSTM GRU and RNN The ARR and ASR of allML algorithms are significantly greater than those of BAHand benchmark index the MDD of all ML algorithms aresignificantly smaller than that of the benchmark index butsignificantly greater than that of BAH strategy

From the above analysis and evaluation we can see thatthe directional evaluation indicators of some DNN modelsare very competitive in CSICS while the indicators of sometraditional ML algorithms have excellent performance inSPICS Whether in SPICS or CSICS the ARR and ASR ofall ML algorithms are significantly greater than that of thebenchmark index and BAH strategy respectively In all MLalgorithms there are always some traditional ML algorithmswhich are not significantly worse than the best DNN modelfor any performance evaluation indicator (ARR ASR andMDD)Therefore if we do not consider transaction cost andother factors affecting trading performance of DNN modelsare alternative but not the best choice when they are appliedto stock trading

In the same period the ARR of any ML algorithm inCSICS is significantly greater than that of the same algorithmin SPICS (p valuelt0001 in theNemenyi test)Meanwhile theMDD of any ML algorithm in CSICS is significantly greaterthan that of the same algorithm in SPICS (p value lt0001in the Nemenyi test) The results show that the quantitativetrading algorithms can more easily obtain excess returns inthe Chinese A-share market but the volatility risk of tradingin Chinese A-share market is significantly higher than that ofthe US stock market in the past 8 years

6 The Impact of Transaction Cost onPerformance of ML Algorithms

Trading cost can affect the profitability of a stock tradingstrategy Transaction cost that can be ignored in long-termstrategies is significantly magnified in daily trading Howevermany algorithmic trading studies assume that transactioncost does not exist ([10 17] etc) In practice frictions suchas transaction cost can distort the market from the perfectmodel in textbooks The cost known prior to trading activityis referred to as transparent such as commissions exchangefees and taxes The costs that has to be estimated are knownas implicit including comprise bid-ask spread latency orslippage and related market impact This section focuses onthe transparent and implicit cost and how do they affecttrading performance in daily trading

61 Experimental Settings and Backtesting Algorithm In thispart the transparent transaction cost is calculated by a certainpercentage of transaction turnover for convenience theimplicit transaction cost is very complicated in calculationand it is necessary to make a reasonable estimate for therandom changes of market environment and stock pricesTherefore we only discuss the impact of slippage on tradingperformance

The transaction cost structures of American stocks aresimilar to that of Chinese A-shares We assume that transpar-ent transaction cost is calculated by a percentage of turnoversuch as less than 05 [40 41] and 02 and 05 in theliterature [42] It is different for the estimation of slippage

In some quantitative trading simulation software such asJoinQuant [43] and Abuquant [44] the slippage is set to 002The transparent transaction cost and implicit transaction costare charged in both directions when buying and selling Itis worth noting that the transparent transaction cost varieswith the different brokers while the implicit transaction costis related to market liquidity market information networkstatus trading software etc

We set slippages s = s0=0 s1=001 s2=002 s3=003s4=004 the transparent transaction cost c = c0=0 c1=0001c2=0002 c3=0003 c4=0004 c5=0005 For different s ccombinations we study the impact of different transactioncost structures on trading performance We assume thatbuying and selling positions are one unit so the turnover isthe corresponding stock price When buying stocks we notonly need to pay a certain percentage cost of the purchaseprice but also need to pay an uncertain slippage cost Thatis we need to pay a higher price than the real-time price119875119905minus1

when we are buying But when selling stocks we notonly need to pay a certain percentage cost of the sellingprice but also to pay an uncertain slippage cost Generallyspeaking we need to sell at a price lower than the real-timeprice 119875

119905 It is worth noting that our trading strategy is self-

financing If ML algorithms predict the continuous occur-rence of buying signals or selling signals ie |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 0 we will continue to hold or do nothingso the transaction cost at this time is 0 when |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 1 it is indicated that the position maybe changed from holding to selling or from empty positionto buying At this time we would pay transaction costdue to the trading operation Finally we get a real yieldis

119877119890119905119905le119862119897119900119904119890119875119903119894119888119890

119905minus 119862119897119900119904119890119875119903119894119888119890

119905minus1

119862119897119900119904119890119875119903119894119888119890119905minus1

119875119905= 119862119897119900119904119890119875119903119894119888119890

119905

lowast (1 minus 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816)

minus 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816

119875119905minus1

= 119862119897119900119904119890119875119903119894119888119890119905minus1

lowast (1 + 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816)

+ 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816

119877119890119905119905=119875119905minus 119875119905minus1

119875119905minus1

(5)

where 119862119897119900119904119890119875119903119894119888119890119905

denotes the 119905-th closing price119879119903119886119889119890119878119894119892119899119886119897

119905denotes the 119905-th trading signal 119875

119905denotes

the 119905-th executing price and 119877119890119905119905denotes the 119905-th return rate

We propose a backtesting algorithm with transaction costbased on the above analysis as is shown in Algorithm 3

18 Mathematical Problems in Engineering

Input TS TS is trading signals of a stocks s is slippagec c is transparent transaction cost

Output WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) WR=NULL ARR=NULL ASR=NULL MDD=NULL(3) for (i in 1 N) (4) Stock Data=Stock Code List[i](5) ClosePricet=Stock Data [ldquoClosing Pricerdquo](6) Pt =ClosePricet lowast(1-clowastabs(TSt-TSt-1)) - slowastabs(TSt-TSt-1)(7) Pt-1 =ClosePricetlowast(1+clowastabs(TSt-TSt-1)) + slowastabs(TSt-TSt-1)(8) Rett= (Pt- Pt-1) Pt Ret is the return rate series(9) TDRR=lag (TS)lowastRet TDRR is the daily return through trading(10) WR[i]=sum (TDRRgt0)sum(TDRR =0)(11) ARR[i]=Returnannualized (TDRR)(12) ASR[i]=SharpeRatioannualized (TDRR)(13) MDD[i]=maxDrawDown (TDRR)(14) WR=c (WR WR[i])(15) ARR=c (ARR ARR[i])(16) ASR=c (ASR ASR[i])(17) MDD=c (MDD MDD[i])(18) (19) return (WR ARR ASR MDD)

Algorithm 3 Backtesting algorithm with transaction cost in R language

62 Analysis of Impact of Transaction Cost on the TradingPerformance of SPICS Transaction cost is one of the mostimportant factors affecting trading performance In US stocktrading transparent transaction cost can be charged accord-ing to a fixed fee per order or month or a floating fee basedon the volume and turnover of each transaction Sometimescustomers can also negotiate with broker to determinetransaction cost The transaction cost charged by differentbrokers varies greatly Meanwhile implicit transaction costis not known beforehand and the estimations of them arevery complex Therefore we assume that the percentageof turnover is the transparent transaction cost for ease ofcalculation In the aspect of implicit transaction cost we onlyconsider the impact of slippage on trading performance

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 24 WR is decreasing with the increase oftransaction cost for any trading algorithm which is intuitiveWhen the transaction cost is set to (s c) = (004 0005) theWR of each algorithm is the lowest Compared with setting(s c) = (0 0) the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR and SVM to XGB are reduced by580 597 591 1583 1804 1395 2171 16042216 1854 1850 and 2597 respectively ThereforeMLP DBN and SAE are more tolerant to transaction costGenerally speaking the DNN models have stronger capacityto accommodate transaction cost than the traditional MLmodels From the single trading algorithm such as MLP ifwe do not consider slippage ie s=0 the average WR ofMLP is 05510 under transaction cost structures (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not considertransparent transaction cost ie c=0 the averageWRofMLP

is 05618 under transaction cost structures (s1 c0) (s2 c0)(s3 c0) (s4 c0) so transparent transaction cost has greaterimpact than slippageThroughmultiple comparative analysisthe WR under the transaction cost structure (s1 c0) is notsignificantly different from the WR without transaction costfor MLP DBN and SAETheWR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the WR under the transaction cost structure (s1 c0) (s2 c0) are not significantly different from theWRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 25 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the lowest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 4031 4157 and 4093 respectivelywhile the ARR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin accounts For a general setting of s and c ie (s c) = (0020003) ARR of MLP DBN and SAE decrease by 23262400 and 2361 respectively while the ARR of otheralgorithms decrease by more than 50 and that of CARTand XGB decrease bymore than 100ThereforeMLP DBNand SAE are more tolerant to high transaction cost Fromsingle trading algorithm such as RNN if we do not considerslippage ie s=0 the average ARR of RNN is 01434 under

Mathematical Problems in Engineering 19

Table24Th

eWRof

SPICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

05676

05680

05683

05843

05825

05844

05266

05930

05912

05859

05831

05891

(s0c1)

05615

05618

05621

05669

05626

05694

05052

05752

05663

05654

05630

05599

(s0c2)

05560

05560

05564

05507

05442

05553

04847

05585

05429

05463

05438

05324

(s0c3)

05507

05506

05510

05353

05269

05418

04652

05424

05205

05278

05253

05061

(s0c4)

05457

05454

05460

05206

05101

05289

044

7005277

04996

05105

05084

04818

(s0c5)

05410

05407

05412

05071

04946

05170

04303

05138

04803

04947

04924

04594

(s1c0)

056

49056

53056

5605778

05751

05785

05190

058

61058

2405782

05759

05788

(s1c1)

05594

05597

05600

05619

05571

05648

04991

05700

05597

05595

05574

05521

(s1c2)

05539

05539

05544

05458

05389

05508

04788

05534

05364

05406

05383

05249

(s1c3)

05487

05486

05491

05305

05215

05375

04597

05375

05141

05223

05200

04988

(s1c4)

05438

05436

05441

05163

05052

05249

044

1805231

04938

05054

05034

04750

(s1c5)

05394

05390

05396

05032

04902

05132

04255

05097

04751

04900

04880

04532

(s2c0)

05628

05631

05635

05729

056

9705741

05134

058

1105758

05726

05704

05713

(s2c1)

05573

05574

05578

05568

05515

05602

04931

05647

05527

05535

05515

05442

(s2c2)

05518

05518

05523

05408

05336

05463

04729

05482

05297

05349

05326

05172

(s2c3)

05469

05467

05472

05260

05164

05334

04543

05330

05082

05171

05150

04918

(s2c4)

05421

05417

05423

05120

05004

05209

04368

05187

04881

05004

04986

046

85(s2c5)

05377

05373

05379

04993

04858

05096

04209

05055

04699

04855

04835

044

73(s3c0)

05606

05609

05612

05678

05640

05694

05074

05759

05690

05668

05646

05635

(s3c1)

05552

05553

05558

05518

05460

05556

04872

05595

05460

05478

05459

05365

(s3c2)

05499

05498

05503

05362

05284

05422

046

7505434

05233

05295

05273

05099

(s3c3)

05450

05448

05453

05216

05114

05292

04491

05284

05020

05120

05098

04849

(s3c4)

05405

05401

05407

05080

04960

05172

04321

05146

04827

04959

04940

04622

(s3c5)

05362

05357

05363

04955

04816

05063

04166

05017

04651

04815

04793

044

17(s4c0)

05587

05589

05593

05630

05588

05652

05019

05710

05627

05613

05593

05562

(s4c1)

05533

05533

05537

05470

05407

05513

04815

05544

05395

05424

05404

05290

(s4c2)

05480

05479

05484

05316

05232

05380

04620

05386

05171

05242

05220

05026

(s4c3)

05432

05429

05435

05172

05067

05253

044

4005241

04964

05070

05051

04782

(s4c4)

05388

05384

05391

05041

04917

05137

04274

05106

04775

04914

04897

04564

(s4c5)

05347

05341

05347

04918

04774

05029

04123

04979

046

0204773

04752

04361

20 Mathematical Problems in Engineering

Table25Th

eARR

ofSP

ICSford

ailytradingwith

different

transactioncost

Ther

esultthatthere

isno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

03332

03296

03325

02943

02920

02934

03317

02975

03133

02942

03067

03041

(s0c1)

03128

030

8703118

02439

02327

02521

02266

02496

02384

02336

02400

02137

(s0c2)

02924

02879

02912

01936

01735

02108

01216

02017

01636

01731

01734

01234

(s0c3)

02721

02672

02706

01433

0114

301697

00168

01539

00889

01126

01070

00333

(s0c4)

02519

02464

02500

00931

00553

01285

-00878

01062

00143

00522

004

06-00567

(s0c5)

02316

02257

02294

00430

-00037

00875

-019

2400586

-00602

-0008

-00257

-014

66(s1c0)

03249

03212

03242

027

7802729

02794

029

53028

18028

9802747

028

5502762

(s1c1)

03046

03004

03035

02274

02136

02381

01902

02339

02149

02141

02188

01859

(s1c2)

02842

02796

02829

01771

01544

01969

00853

01861

01401

01536

01523

00957

(s1c3)

02639

02588

02623

01269

00953

01557

-00195

01383

00654

00931

00858

000

56(s1c4)

02437

02381

02417

00767

00363

0114

6-012

41009

06-00091

00328

00195

-00844

(s1c5)

02234

02174

02211

00266

-00226

00735

-02285

00430

-00836

-00275

-0046

8-01742

(s2c0)

03167

03129

03159

026

1302538

026

54025

89026

61026

6302551

026

43024

84(s2c1)

02964

02921

02952

02110

01946

02241

01539

02182

01914

01946

01977

01581

(s2c2)

0276

02713

02746

01607

01354

01829

00490

01704

0116

701341

01312

006

79(s2c3)

02557

02505

02540

0110

400763

01418

-00557

01227

004

2000737

006

47-00221

(s2c4)

02355

02298

02334

006

0300173

01007

-016

0300750

-00325

00134

-00016

-01120

(s2c5)

02153

02091

02129

00102

-00416

00597

-0264

700274

-010

69-00469

-00678

-02018

(s3c0)

030

85030

46030

7602448

02348

02514

02225

02504

02428

02356

02431

02206

(s3c1)

02881

02838

02869

01945

01756

02102

0117

502026

01680

01751

01765

01304

(s3c2)

02678

02630

02663

01442

01164

01690

00127

01548

00933

0114

601100

004

02(s3c3)

02476

02422

02457

00940

00574

01279

-00919

01071

00187

00543

00436

-00498

(s3c4)

02273

02215

02252

00439

-00016

00868

-019

6400595

-00558

-0006

-00227

-013

97(s3c5)

02071

02008

02047

-00062

-0060

5004

58-0300

800119

-013

02-00662

-00889

-02294

(s4c0)

03003

02962

02993

02284

02157

02374

01862

02348

02193

02161

02219

01929

(s4c1)

02799

02754

02786

01781

01565

01962

00813

01870

01445

01556

01554

01026

(s4c2)

02597

02547

02580

01278

00974

01551

-00235

01392

00699

00952

00889

00125

(s4c3)

02394

02339

02375

00776

00384

0114

0-012

8100915

-0004

700349

00226

-00774

(s4c4)

02192

02132

02169

00275

-00205

00729

-02326

00439

-00792

-00254

-00437

-016

73(s4c5)

01989

01926

01964

-00225

-00794

00319

-033

69-00037

-015

35-00856

-010

99-02570

Mathematical Problems in Engineering 21

the transaction cost structures (s0 c1) (s0 c2) (s0 c3) (s0c4) (s0 c5) if we do not consider transparent transactioncost ie c=0 the average ARR of RNN is 02531 under thetransaction cost structure (s1 c0) (s2 c0) (s3 c0) (s4c0) so transparent transaction cost has greater impact thanslippage Through multiple comparative analysis the ARRunder the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s0 c1) are not significantly different from the ARRwithout transaction cost for MLP DBN and SAE the ARRunder all other transaction cost structures are significantlysmaller than theARRwithout transaction cost For all tradingalgorithms except for MLP DBN and SAE the ARR underthe transaction cost structures (s1 c0) (s2 c0) are notsignificantly different from the ARR without transactioncost the ARR under all other transaction cost structures aresignificantly smaller than the ARR without transaction cost

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 26 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theASR of each algorithm is the lowest Compared with settingwithout transaction cost the ASR of MLP DBN and SAEreduce by 3997 4123 and 4066 respectively while theASR of other trading algorithms reduce by more than 90compared with the case of no transaction cost Thereforeexcessive transaction cost will significantly reduce ASR Fora general setting of s and c ie (s c) = (002 0003) theASR of MLP DBN and SAE decrease by 2262 2336and 2302 respectively while the ASR of other algorithmsdecrease by more than 50 the ASR of CART and XGBdecrease by more than 100Therefore MLP DBN and SAEare more tolerant to transaction cost From single tradingalgorithm such as NB if we do not consider slippage ies=0 the average ASR of NB is 08052 under the transactioncost structure (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5)if we do not consider transparent transaction cost ie c=0the average ASR of NB is 14182 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has greater impact than slippage Throughmultiple comparative analysis the ASR under the transactioncost structures (s1 c0) (s2 c0) (s3 c0) (s0 c1) are notsignificantly different from the ASR without transaction costfor MLP DBN and SAE the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the ASR under the transaction cost structures(s1 c0) (s2 c0) are not significantly different from the ASRwithout transaction cost the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 27 MDD increases with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the settings without transaction cost theMDD of MLP DBN and SAE increase by 932 1108 and

1032 respectively The MDD of other trading algorithmsincrease by more than 80 compared with those withoutconsidering transaction costTherefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 483 580 and 533respectively while the MDD of other algorithms increase bymore than 35 and theMDDofCART RF andXGB increasebymore than 100Therefore MLP DBN and SAE are moretolerant to transaction cost As awhole theDNNmodels havestronger capacity to accommodate transaction cost than thetraditional ML models From single trading algorithm suchas GRU if we do not consider slippage ie s=0 the averageMDD of GRU is 04459 under the transaction cost structures(s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do notconsider transparent transaction cost ie c=0 the averageMDD of GRU is 03559 under the transaction cost structures(s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparent transactioncost has greater impact than slippage Through multiplecomparative analysis the MDD under any the transactioncost structure is not significantly different from the MDDwithout transaction cost for MLP DBN and SAE For alltrading algorithms except for MLP DBN and SAE such asLR the MDD under the transaction cost structures (s0 c1)(s1 c0) (s2 c0) (s3 c0) are not significantly different fromthe MDD without transaction cost the MDD under all othertransaction cost structures are significantly greater than theMDD without transaction cost

Through the analysis of the Table 27 performance eval-uation indicators we find that trading performance afterconsidering transaction cost will be worse than that withoutconsidering transaction cost as is in actual trading situationIt is noteworthy that the performance changes of DNNalgorithms especially MLP DBN and SAE are very smallafter considering transaction cost This shows that the threealgorithms have good tolerance to changes of transactioncost Especially for the MDD of the three algorithms thereis no significant difference with that with no transactioncost So we can consider applying them in actual tradingMeanwhile we conclude that the transparent transactioncost has greater impact on the trading performances thanthe slippage for SPICS This is because the prices of SPICSare too high when the transparent transaction cost is setto a certain percentage of turnover In actual transactionsspecial attention needs to be paid to the fact that the trans-action performance under most transaction cost structuresis significantly lower than the trading performance withoutconsidering transaction cost It is worth noting that theperformance of traditional ML algorithm is not worse thanthat ofDNNalgorithmswithout considering transaction costwhile the performance of DNN algorithms is better than thatof traditional ML algorithms after considering transactioncost

63 Analysis of Impact of Transaction Cost on the TradingPerformance of CSICS Similar to Section 62 we will discussthe impact of transaction cost on trading performance ofCSICS in the followings In the Chinese A-share marketthe transparent transaction cost is usually set to a certain

22 Mathematical Problems in Engineering

Table26Th

eASR

ofSP

ICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

1546

815

412

15502

15764

15571

15828

13927

16237

16763

15818

16018

16298

(s0c1)

1456

214

478

14577

1300

012

317

13565

09346

13554

12650

12472

12456

11294

(s0c2)

13639

13527

13635

10191

09015

11262

04657

10822

08482

09074

08846

06236

(s0c3)

12702

12561

12679

07355

05690

08929

-00085

08061

04298

05652

05216

0118

2(s0c4)

11751

11581

11709

04511

02366

06580

-04823

05291

00139

02234

01596

-03812

(s0c5)

1079

10591

10728

01678

-00931

04227

-09500

02534

-039

59-01152

-019

87-08696

(s1c0)

15121

1505

715

149

1492

714

606

15119

1244

915

424

1558

214

825

14974

1488

6(s1c1)

14208

14116

14217

12146

11334

12841

07823

12722

1144

711459

11394

09859

(s1c2)

13279

13159

13270

09325

08020

10526

03105

09977

07267

08048

07772

04792

(s1c3)

12337

12188

12308

064

8204690

08185

-016

4607209

03082

04622

04139

-00257

(s1c4)

11382

11204

11333

03637

01368

05831

-06374

04438

-010

6801208

00524

-052

31(s1c5)

10417

10210

10348

00807

-019

2003478

-110

2501686

-05146

-02169

-0304

7-10083

(s2c0)

1477

1469

914

792

1408

113

632

1440

310

946

1460

114

390

1382

213

922

1346

2(s2c1)

13851

13752

13854

11285

10343

12111

06283

11883

10237

10439

10325

08416

(s2c2)

12916

12789

12901

08454

07021

09785

01547

09128

060

4907019

06696

03346

(s2c3)

11969

11812

11934

05607

03688

07437

-032

0506355

01868

03591

03063

-016

90(s2c4)

11010

10825

10955

02763

00372

05081

-07916

03586

-02268

00183

-00545

-06639

(s2c5)

1004

109827

09967

-0006

-02905

02729

-12533

00841

-06323

-031

79-04101

-114

54(s3c0)

14415

14337

14432

13227

12650

13679

09425

13770

13189

12810

12862

12030

(s3c1)

13490

13384

13488

10419

09348

11375

04733

11039

09023

09413

09252

06971

(s3c2)

12551

12416

12529

07580

060

19090

40-00013

08275

04832

05988

05618

01904

(s3c3)

11599

11435

11558

04731

02688

066

88-04757

05500

00658

02562

01988

-031

16(s3c4)

10636

10443

10575

01891

-00620

04331

-0944

202735

-0346

0-00836

-016

08-08034

(s3c5)

09664

09443

09584

-00924

-03883

01982

-14018

000

00-074

89-04183

-05146

-12808

(s4c0)

14058

13972

1406

812

368

11662

12950

07892

12933

11983

11793

11796

10591

(s4c1)

13127

13013

13119

09549

08350

10634

03180

10190

07807

08386

08177

05527

(s4c2)

12183

1204

12155

06705

05018

08293

-015

6807421

03617

04958

04542

004

68(s4c3)

11226

11055

11179

03857

01691

05938

-06295

046

47-00545

01537

00918

-04529

(s4c4)

1026

1006

10193

01021

-016

0703582

-10948

01888

-0464

2-018

49-02665

-09413

(s4c5)

09286

09057

09199

-017

83-04853

01238

-15478

-00836

-0864

2-05177

-06182

-14142

Mathematical Problems in Engineering 23

Table 27 The MDD of SPICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 03583 03584 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338(s0 c1) 03629 03638 03594 03779 03986 03636 04072 03712 03843 03963 03972 04203(s0 c2) 03677 03695 03647 04302 04707 03968 05168 04127 04842 04729 04787 05735(s0 c3) 03727 03756 03703 04990 05639 04376 06564 04709 06172 05682 05844 07335(s0 c4) 03781 03821 03764 05767 06612 04873 07804 05424 07377 06653 06913 08447(s0 c5) 03839 03890 03828 06529 0746 05444 08730 06162 08272 07501 07808 09118(s1 c0) 03596 03600 03560 03500 036130 03446 03574 03502 03414 03585 03569 03540(s1 c1) 03642 03655 03609 03907 04156 03717 04320 03814 04067 04154 04170 04541(s1 c2) 03691 03712 03662 04466 04936 04066 05534 04270 05172 04971 05049 06168(s1 c3) 03742 03774 03720 05183 05895 04495 06928 04885 06499 05937 06129 07662(s1 c4) 03796 03839 03781 05961 06842 05013 08105 05610 07631 06884 07161 08649(s1 c5) 03856 03909 03847 0671 07646 05595 08946 06342 08451 07691 0800 09235(s2 c0) 03609 03615 03573 03607 03756 03517 03770 03586 03586 03739 03727 03787(s2 c1) 03656 03671 03623 04047 04349 03805 04627 03929 04339 04365 04397 04929(s2 c2) 03705 03729 03678 04642 05176 04171 05916 04424 05504 05218 05327 06577(s2 c3) 03756 03792 03736 05377 06143 04624 07277 05067 06805 06183 06402 07939(s2 c4) 03812 03859 03799 06155 07056 05161 08380 05796 07856 07099 07388 08816(s2 c5) 03873 03930 03866 06887 07816 05751 09126 06517 08606 07864 08172 09331(s3 c0) 03622 03631 03588 03729 03912 03594 04004 03685 03795 03909 03909 04081(s3 c1) 03669 03687 03639 04200 04555 03901 04966 04062 04622 04587 04642 05334(s3 c2) 03719 03746 03694 04826 05423 04286 06295 04589 05833 05465 05607 06936(s3 c3) 03772 03811 03754 05572 06377 04762 07609 05248 07081 06420 06657 08175(s3 c4) 03829 03879 03818 06341 07254 05314 08620 05980 08054 07300 07593 08956(s3 c5) 03894 03954 03888 07056 07972 05909 09275 06689 08740 08022 08325 09412(s4 c0) 03635 03647 03602 03861 04082 03678 04274 03798 04015 04096 04114 04396(s4 c1) 03683 03704 03654 04362 04774 04005 05325 04211 04908 04814 04894 05730(s4 c2) 03734 03765 03712 05013 05664 04410 06667 04758 06142 05707 05875 07253(s4 c3) 03790 03833 03775 05765 06600 04905 07906 05429 07330 06644 06894 08375(s4 c4) 03851 03904 03841 06521 07439 05470 08824 06162 08230 07485 07782 09074(s4 c5) 03917 03981 03913 07218 08115 06067 09395 06857 08858 08165 08463 09480

percentage of turnover and it is the same as the assumptionin the experimental settings As in the US stock market thesmallest unit of price change is 001 (one tick) It is reasonableto set slippage to be 001-005 Of course it should be notedthat the prices fluctuation may be more intense when closingthan that in the middle of a trading day

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 28 the WR is decreasing with the increaseof transaction cost for any trading algorithm When thetransaction cost is set to (s c) = (004 0005) the WR of eachalgorithm is the smallest Comparedwith the settings withouttransaction cost the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR SVM and XGB are reduced by671 688 697 2269 1726 1548 2430 14912484 2112 2112 and 2919 respectively For a generalsetting of s and c ie (s c) = (002 0003) the WR ofMLP DBN and SAE decrease by 410 420 and 430respectively while the WR of other algorithms decrease bymore than 9 the WR of CART RF and XGB decrease by

more than 15 Therefore MLP DBN and SAE are moretolerant to transaction cost From single trading algorithmsuch as LSTM if we do not consider slippage ie s=0 theaverage WR of DBN is 05417 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage WR of LSTM is 05304 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the WR under the transactioncost structures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the WR without transaction cost for MLPDBN SAE and NB the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN SAE and NB the WR under the transaction coststructure (s0 c1) is not significantly different from the WRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

24 Mathematical Problems in Engineering

Table 28 The WR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803(s0 c1) 05523 05527 05525 05525 05608 05620 05009 05227 05612 05665 05571 05595(s0 c2) 05488 05492 05489 05389 05512 05535 04879 05149 05460 05542 05445 05411(s0 c3) 05453 05456 05452 05258 05414 05451 04747 05068 05313 05418 05320 05234(s0 c4) 05417 05419 05414 05127 05320 05368 04622 04991 05172 05297 05202 05067(s0 c5) 05383 05383 05379 05004 05230 05286 04504 04917 05036 05180 05088 04905(s1 c0) 05494 05499 05497 05444 05541 05558 04925 05170 05520 05584 05492 05488(s1 c1) 05456 05459 05456 05286 05424 05456 04775 05080 05342 05437 05345 05275(s1 c2) 05421 05423 05420 05161 05335 05377 04654 05007 05207 05320 05231 05110(s1 c3) 05386 05388 05383 05036 05246 05296 04530 04931 05065 05205 05116 04946(s1 c4) 05353 05354 05349 04915 05156 05218 04419 04861 04937 05095 05007 04795(s1 c5) 05323 05323 05317 04808 05076 05148 04315 04796 04817 04995 04905 04652(s2 c0) 05431 05434 05431 05219 05368 05403 04707 05036 05269 05374 05286 05189(s2 c1) 05395 05397 05393 05078 05266 05314 04573 04956 05115 05242 05154 05005(s2 c2) 05360 05361 05357 04960 05181 05237 04458 04886 04985 05134 05046 04853(s2 c3) 05331 05331 05326 04850 05100 05167 04352 04818 04864 05031 04945 04711(s2 c4) 05300 05300 05293 04743 05018 05093 04252 04752 04746 04931 04846 04572(s2 c5) 05273 05271 05266 04648 04946 05029 04159 04692 04639 04838 04755 04445(s3 c0) 05373 05374 05371 05019 05216 05265 04514 04917 05049 05186 05098 04932(s3 c1) 05341 05341 05336 04902 05128 05188 04399 04846 04917 05074 04990 04775(s3 c2) 05312 05312 05306 04798 05052 05122 04303 04782 04804 04977 04896 04644(s3 c3) 05281 05281 05275 04696 04976 05049 04206 04718 04689 04879 04799 04509(s3 c4) 05252 05251 05245 04598 04901 04984 04110 04657 04581 04785 04707 04378(s3 c5) 05226 05223 05218 04510 04833 04924 04023 04602 04481 04701 04621 04264(s4 c0) 05325 05325 05321 04860 05089 05150 04360 04816 04870 05030 04949 04723(s4 c1) 05294 05294 05289 04753 05010 05079 04258 04750 04752 04928 04849 04588(s4 c2) 05266 05265 05259 04653 04937 05013 04164 04690 04642 04838 04761 04458(s4 c3) 05238 05236 05230 04562 04864 04948 04073 04632 04541 04747 04672 04336(s4 c4) 05211 05208 05203 04475 04798 04891 03985 04577 04440 04662 04586 04218(s4 c5) 05186 05182 05176 04392 04733 04832 03901 04524 04348 04582 04509 04109

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 29 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the smallest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 5073 5175 and 5225 respectivelyWhile the ARR of other trading algorithms decrease bymore than 100 compared with those algorithms withouttransaction cost Therefore excessive transaction cost canlead to serious losses in the accounts For a general settingof s and c ie (s c) = (002 0003) ARR of MLP DBNand SAE decrease by 2741 2797 and 2825 respectivelywhile the ARR other algorithms decrease by more than 50and that of CART NB RF and XGB decrease by more than100 Therefore MLP DBN and SAE are more tolerant totransaction cost From single trading algorithm such as SAEif we do not consider slippage ie s=0 the average ARR ofSAE is 05040 under the transaction cost structure (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not consider

transparent transaction cost ie c=0 the averageARRof SAEis 04468 under the transaction cost structures (s1 c0) (s2c0) (s3 c0) (s4 c0) so transparent transaction cost hassmaller impact than slippage Through multiple comparativeanalysis the ARR under the transaction cost structures (s0c1) (s0 c2) (s0 c3) (s0 c1) (s1 c1) are not significantlydifferent from the ARR without transaction cost for MLPDBN and SAE the ARR under all other transaction coststructures are significantly smaller than the ARR withouttransaction cost For RNN LSTM GRU CART RF LR andSVM the ARR under the transaction cost structures (s0c1) (s0 c2) (s1 c0) are not significantly different fromthe ARR without transaction cost the ARR under all othertransaction cost structures are significantly smaller than theARR without transaction cost For NB and XGB the ARRunder the transaction cost structures (s0 c1) (s1 c0) arenot significantly different from the ARR without transactioncost the ARR under all other transaction cost structuresare significantly smaller than the ARR without transactioncost

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 17: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

Mathematical Problems in Engineering 17

six DNN algorithms are not significantly different from alltraditional ML models except NB and CART The MDD ofLR and XGB are significantly smaller than those of MLPDBN and SAE and are not significantly different fromthat of LSTM GRU and RNN The ARR and ASR of allML algorithms are significantly greater than those of BAHand benchmark index the MDD of all ML algorithms aresignificantly smaller than that of the benchmark index butsignificantly greater than that of BAH strategy

From the above analysis and evaluation we can see thatthe directional evaluation indicators of some DNN modelsare very competitive in CSICS while the indicators of sometraditional ML algorithms have excellent performance inSPICS Whether in SPICS or CSICS the ARR and ASR ofall ML algorithms are significantly greater than that of thebenchmark index and BAH strategy respectively In all MLalgorithms there are always some traditional ML algorithmswhich are not significantly worse than the best DNN modelfor any performance evaluation indicator (ARR ASR andMDD)Therefore if we do not consider transaction cost andother factors affecting trading performance of DNN modelsare alternative but not the best choice when they are appliedto stock trading

In the same period the ARR of any ML algorithm inCSICS is significantly greater than that of the same algorithmin SPICS (p valuelt0001 in theNemenyi test)Meanwhile theMDD of any ML algorithm in CSICS is significantly greaterthan that of the same algorithm in SPICS (p value lt0001in the Nemenyi test) The results show that the quantitativetrading algorithms can more easily obtain excess returns inthe Chinese A-share market but the volatility risk of tradingin Chinese A-share market is significantly higher than that ofthe US stock market in the past 8 years

6 The Impact of Transaction Cost onPerformance of ML Algorithms

Trading cost can affect the profitability of a stock tradingstrategy Transaction cost that can be ignored in long-termstrategies is significantly magnified in daily trading Howevermany algorithmic trading studies assume that transactioncost does not exist ([10 17] etc) In practice frictions suchas transaction cost can distort the market from the perfectmodel in textbooks The cost known prior to trading activityis referred to as transparent such as commissions exchangefees and taxes The costs that has to be estimated are knownas implicit including comprise bid-ask spread latency orslippage and related market impact This section focuses onthe transparent and implicit cost and how do they affecttrading performance in daily trading

61 Experimental Settings and Backtesting Algorithm In thispart the transparent transaction cost is calculated by a certainpercentage of transaction turnover for convenience theimplicit transaction cost is very complicated in calculationand it is necessary to make a reasonable estimate for therandom changes of market environment and stock pricesTherefore we only discuss the impact of slippage on tradingperformance

The transaction cost structures of American stocks aresimilar to that of Chinese A-shares We assume that transpar-ent transaction cost is calculated by a percentage of turnoversuch as less than 05 [40 41] and 02 and 05 in theliterature [42] It is different for the estimation of slippage

In some quantitative trading simulation software such asJoinQuant [43] and Abuquant [44] the slippage is set to 002The transparent transaction cost and implicit transaction costare charged in both directions when buying and selling Itis worth noting that the transparent transaction cost varieswith the different brokers while the implicit transaction costis related to market liquidity market information networkstatus trading software etc

We set slippages s = s0=0 s1=001 s2=002 s3=003s4=004 the transparent transaction cost c = c0=0 c1=0001c2=0002 c3=0003 c4=0004 c5=0005 For different s ccombinations we study the impact of different transactioncost structures on trading performance We assume thatbuying and selling positions are one unit so the turnover isthe corresponding stock price When buying stocks we notonly need to pay a certain percentage cost of the purchaseprice but also need to pay an uncertain slippage cost Thatis we need to pay a higher price than the real-time price119875119905minus1

when we are buying But when selling stocks we notonly need to pay a certain percentage cost of the sellingprice but also to pay an uncertain slippage cost Generallyspeaking we need to sell at a price lower than the real-timeprice 119875

119905 It is worth noting that our trading strategy is self-

financing If ML algorithms predict the continuous occur-rence of buying signals or selling signals ie |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 0 we will continue to hold or do nothingso the transaction cost at this time is 0 when |119879119903119886119889119890119878119894119892119899119886119897

119905minus

119879119903119886119889119890119878119894119892119899119886119897119905minus1

| = 1 it is indicated that the position maybe changed from holding to selling or from empty positionto buying At this time we would pay transaction costdue to the trading operation Finally we get a real yieldis

119877119890119905119905le119862119897119900119904119890119875119903119894119888119890

119905minus 119862119897119900119904119890119875119903119894119888119890

119905minus1

119862119897119900119904119890119875119903119894119888119890119905minus1

119875119905= 119862119897119900119904119890119875119903119894119888119890

119905

lowast (1 minus 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816)

minus 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus1

1003816100381610038161003816

119875119905minus1

= 119862119897119900119904119890119875119903119894119888119890119905minus1

lowast (1 + 119888 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816)

+ 119904 lowast 1003816100381610038161003816119879119903119886119889119890119878119894119892119899119886119897119905minus1 minus 119879119903119886119889119890119878119894119892119899119886119897119905minus2

1003816100381610038161003816

119877119890119905119905=119875119905minus 119875119905minus1

119875119905minus1

(5)

where 119862119897119900119904119890119875119903119894119888119890119905

denotes the 119905-th closing price119879119903119886119889119890119878119894119892119899119886119897

119905denotes the 119905-th trading signal 119875

119905denotes

the 119905-th executing price and 119877119890119905119905denotes the 119905-th return rate

We propose a backtesting algorithm with transaction costbased on the above analysis as is shown in Algorithm 3

18 Mathematical Problems in Engineering

Input TS TS is trading signals of a stocks s is slippagec c is transparent transaction cost

Output WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) WR=NULL ARR=NULL ASR=NULL MDD=NULL(3) for (i in 1 N) (4) Stock Data=Stock Code List[i](5) ClosePricet=Stock Data [ldquoClosing Pricerdquo](6) Pt =ClosePricet lowast(1-clowastabs(TSt-TSt-1)) - slowastabs(TSt-TSt-1)(7) Pt-1 =ClosePricetlowast(1+clowastabs(TSt-TSt-1)) + slowastabs(TSt-TSt-1)(8) Rett= (Pt- Pt-1) Pt Ret is the return rate series(9) TDRR=lag (TS)lowastRet TDRR is the daily return through trading(10) WR[i]=sum (TDRRgt0)sum(TDRR =0)(11) ARR[i]=Returnannualized (TDRR)(12) ASR[i]=SharpeRatioannualized (TDRR)(13) MDD[i]=maxDrawDown (TDRR)(14) WR=c (WR WR[i])(15) ARR=c (ARR ARR[i])(16) ASR=c (ASR ASR[i])(17) MDD=c (MDD MDD[i])(18) (19) return (WR ARR ASR MDD)

Algorithm 3 Backtesting algorithm with transaction cost in R language

62 Analysis of Impact of Transaction Cost on the TradingPerformance of SPICS Transaction cost is one of the mostimportant factors affecting trading performance In US stocktrading transparent transaction cost can be charged accord-ing to a fixed fee per order or month or a floating fee basedon the volume and turnover of each transaction Sometimescustomers can also negotiate with broker to determinetransaction cost The transaction cost charged by differentbrokers varies greatly Meanwhile implicit transaction costis not known beforehand and the estimations of them arevery complex Therefore we assume that the percentageof turnover is the transparent transaction cost for ease ofcalculation In the aspect of implicit transaction cost we onlyconsider the impact of slippage on trading performance

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 24 WR is decreasing with the increase oftransaction cost for any trading algorithm which is intuitiveWhen the transaction cost is set to (s c) = (004 0005) theWR of each algorithm is the lowest Compared with setting(s c) = (0 0) the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR and SVM to XGB are reduced by580 597 591 1583 1804 1395 2171 16042216 1854 1850 and 2597 respectively ThereforeMLP DBN and SAE are more tolerant to transaction costGenerally speaking the DNN models have stronger capacityto accommodate transaction cost than the traditional MLmodels From the single trading algorithm such as MLP ifwe do not consider slippage ie s=0 the average WR ofMLP is 05510 under transaction cost structures (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not considertransparent transaction cost ie c=0 the averageWRofMLP

is 05618 under transaction cost structures (s1 c0) (s2 c0)(s3 c0) (s4 c0) so transparent transaction cost has greaterimpact than slippageThroughmultiple comparative analysisthe WR under the transaction cost structure (s1 c0) is notsignificantly different from the WR without transaction costfor MLP DBN and SAETheWR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the WR under the transaction cost structure (s1 c0) (s2 c0) are not significantly different from theWRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 25 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the lowest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 4031 4157 and 4093 respectivelywhile the ARR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin accounts For a general setting of s and c ie (s c) = (0020003) ARR of MLP DBN and SAE decrease by 23262400 and 2361 respectively while the ARR of otheralgorithms decrease by more than 50 and that of CARTand XGB decrease bymore than 100ThereforeMLP DBNand SAE are more tolerant to high transaction cost Fromsingle trading algorithm such as RNN if we do not considerslippage ie s=0 the average ARR of RNN is 01434 under

Mathematical Problems in Engineering 19

Table24Th

eWRof

SPICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

05676

05680

05683

05843

05825

05844

05266

05930

05912

05859

05831

05891

(s0c1)

05615

05618

05621

05669

05626

05694

05052

05752

05663

05654

05630

05599

(s0c2)

05560

05560

05564

05507

05442

05553

04847

05585

05429

05463

05438

05324

(s0c3)

05507

05506

05510

05353

05269

05418

04652

05424

05205

05278

05253

05061

(s0c4)

05457

05454

05460

05206

05101

05289

044

7005277

04996

05105

05084

04818

(s0c5)

05410

05407

05412

05071

04946

05170

04303

05138

04803

04947

04924

04594

(s1c0)

056

49056

53056

5605778

05751

05785

05190

058

61058

2405782

05759

05788

(s1c1)

05594

05597

05600

05619

05571

05648

04991

05700

05597

05595

05574

05521

(s1c2)

05539

05539

05544

05458

05389

05508

04788

05534

05364

05406

05383

05249

(s1c3)

05487

05486

05491

05305

05215

05375

04597

05375

05141

05223

05200

04988

(s1c4)

05438

05436

05441

05163

05052

05249

044

1805231

04938

05054

05034

04750

(s1c5)

05394

05390

05396

05032

04902

05132

04255

05097

04751

04900

04880

04532

(s2c0)

05628

05631

05635

05729

056

9705741

05134

058

1105758

05726

05704

05713

(s2c1)

05573

05574

05578

05568

05515

05602

04931

05647

05527

05535

05515

05442

(s2c2)

05518

05518

05523

05408

05336

05463

04729

05482

05297

05349

05326

05172

(s2c3)

05469

05467

05472

05260

05164

05334

04543

05330

05082

05171

05150

04918

(s2c4)

05421

05417

05423

05120

05004

05209

04368

05187

04881

05004

04986

046

85(s2c5)

05377

05373

05379

04993

04858

05096

04209

05055

04699

04855

04835

044

73(s3c0)

05606

05609

05612

05678

05640

05694

05074

05759

05690

05668

05646

05635

(s3c1)

05552

05553

05558

05518

05460

05556

04872

05595

05460

05478

05459

05365

(s3c2)

05499

05498

05503

05362

05284

05422

046

7505434

05233

05295

05273

05099

(s3c3)

05450

05448

05453

05216

05114

05292

04491

05284

05020

05120

05098

04849

(s3c4)

05405

05401

05407

05080

04960

05172

04321

05146

04827

04959

04940

04622

(s3c5)

05362

05357

05363

04955

04816

05063

04166

05017

04651

04815

04793

044

17(s4c0)

05587

05589

05593

05630

05588

05652

05019

05710

05627

05613

05593

05562

(s4c1)

05533

05533

05537

05470

05407

05513

04815

05544

05395

05424

05404

05290

(s4c2)

05480

05479

05484

05316

05232

05380

04620

05386

05171

05242

05220

05026

(s4c3)

05432

05429

05435

05172

05067

05253

044

4005241

04964

05070

05051

04782

(s4c4)

05388

05384

05391

05041

04917

05137

04274

05106

04775

04914

04897

04564

(s4c5)

05347

05341

05347

04918

04774

05029

04123

04979

046

0204773

04752

04361

20 Mathematical Problems in Engineering

Table25Th

eARR

ofSP

ICSford

ailytradingwith

different

transactioncost

Ther

esultthatthere

isno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

03332

03296

03325

02943

02920

02934

03317

02975

03133

02942

03067

03041

(s0c1)

03128

030

8703118

02439

02327

02521

02266

02496

02384

02336

02400

02137

(s0c2)

02924

02879

02912

01936

01735

02108

01216

02017

01636

01731

01734

01234

(s0c3)

02721

02672

02706

01433

0114

301697

00168

01539

00889

01126

01070

00333

(s0c4)

02519

02464

02500

00931

00553

01285

-00878

01062

00143

00522

004

06-00567

(s0c5)

02316

02257

02294

00430

-00037

00875

-019

2400586

-00602

-0008

-00257

-014

66(s1c0)

03249

03212

03242

027

7802729

02794

029

53028

18028

9802747

028

5502762

(s1c1)

03046

03004

03035

02274

02136

02381

01902

02339

02149

02141

02188

01859

(s1c2)

02842

02796

02829

01771

01544

01969

00853

01861

01401

01536

01523

00957

(s1c3)

02639

02588

02623

01269

00953

01557

-00195

01383

00654

00931

00858

000

56(s1c4)

02437

02381

02417

00767

00363

0114

6-012

41009

06-00091

00328

00195

-00844

(s1c5)

02234

02174

02211

00266

-00226

00735

-02285

00430

-00836

-00275

-0046

8-01742

(s2c0)

03167

03129

03159

026

1302538

026

54025

89026

61026

6302551

026

43024

84(s2c1)

02964

02921

02952

02110

01946

02241

01539

02182

01914

01946

01977

01581

(s2c2)

0276

02713

02746

01607

01354

01829

00490

01704

0116

701341

01312

006

79(s2c3)

02557

02505

02540

0110

400763

01418

-00557

01227

004

2000737

006

47-00221

(s2c4)

02355

02298

02334

006

0300173

01007

-016

0300750

-00325

00134

-00016

-01120

(s2c5)

02153

02091

02129

00102

-00416

00597

-0264

700274

-010

69-00469

-00678

-02018

(s3c0)

030

85030

46030

7602448

02348

02514

02225

02504

02428

02356

02431

02206

(s3c1)

02881

02838

02869

01945

01756

02102

0117

502026

01680

01751

01765

01304

(s3c2)

02678

02630

02663

01442

01164

01690

00127

01548

00933

0114

601100

004

02(s3c3)

02476

02422

02457

00940

00574

01279

-00919

01071

00187

00543

00436

-00498

(s3c4)

02273

02215

02252

00439

-00016

00868

-019

6400595

-00558

-0006

-00227

-013

97(s3c5)

02071

02008

02047

-00062

-0060

5004

58-0300

800119

-013

02-00662

-00889

-02294

(s4c0)

03003

02962

02993

02284

02157

02374

01862

02348

02193

02161

02219

01929

(s4c1)

02799

02754

02786

01781

01565

01962

00813

01870

01445

01556

01554

01026

(s4c2)

02597

02547

02580

01278

00974

01551

-00235

01392

00699

00952

00889

00125

(s4c3)

02394

02339

02375

00776

00384

0114

0-012

8100915

-0004

700349

00226

-00774

(s4c4)

02192

02132

02169

00275

-00205

00729

-02326

00439

-00792

-00254

-00437

-016

73(s4c5)

01989

01926

01964

-00225

-00794

00319

-033

69-00037

-015

35-00856

-010

99-02570

Mathematical Problems in Engineering 21

the transaction cost structures (s0 c1) (s0 c2) (s0 c3) (s0c4) (s0 c5) if we do not consider transparent transactioncost ie c=0 the average ARR of RNN is 02531 under thetransaction cost structure (s1 c0) (s2 c0) (s3 c0) (s4c0) so transparent transaction cost has greater impact thanslippage Through multiple comparative analysis the ARRunder the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s0 c1) are not significantly different from the ARRwithout transaction cost for MLP DBN and SAE the ARRunder all other transaction cost structures are significantlysmaller than theARRwithout transaction cost For all tradingalgorithms except for MLP DBN and SAE the ARR underthe transaction cost structures (s1 c0) (s2 c0) are notsignificantly different from the ARR without transactioncost the ARR under all other transaction cost structures aresignificantly smaller than the ARR without transaction cost

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 26 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theASR of each algorithm is the lowest Compared with settingwithout transaction cost the ASR of MLP DBN and SAEreduce by 3997 4123 and 4066 respectively while theASR of other trading algorithms reduce by more than 90compared with the case of no transaction cost Thereforeexcessive transaction cost will significantly reduce ASR Fora general setting of s and c ie (s c) = (002 0003) theASR of MLP DBN and SAE decrease by 2262 2336and 2302 respectively while the ASR of other algorithmsdecrease by more than 50 the ASR of CART and XGBdecrease by more than 100Therefore MLP DBN and SAEare more tolerant to transaction cost From single tradingalgorithm such as NB if we do not consider slippage ies=0 the average ASR of NB is 08052 under the transactioncost structure (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5)if we do not consider transparent transaction cost ie c=0the average ASR of NB is 14182 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has greater impact than slippage Throughmultiple comparative analysis the ASR under the transactioncost structures (s1 c0) (s2 c0) (s3 c0) (s0 c1) are notsignificantly different from the ASR without transaction costfor MLP DBN and SAE the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the ASR under the transaction cost structures(s1 c0) (s2 c0) are not significantly different from the ASRwithout transaction cost the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 27 MDD increases with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the settings without transaction cost theMDD of MLP DBN and SAE increase by 932 1108 and

1032 respectively The MDD of other trading algorithmsincrease by more than 80 compared with those withoutconsidering transaction costTherefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 483 580 and 533respectively while the MDD of other algorithms increase bymore than 35 and theMDDofCART RF andXGB increasebymore than 100Therefore MLP DBN and SAE are moretolerant to transaction cost As awhole theDNNmodels havestronger capacity to accommodate transaction cost than thetraditional ML models From single trading algorithm suchas GRU if we do not consider slippage ie s=0 the averageMDD of GRU is 04459 under the transaction cost structures(s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do notconsider transparent transaction cost ie c=0 the averageMDD of GRU is 03559 under the transaction cost structures(s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparent transactioncost has greater impact than slippage Through multiplecomparative analysis the MDD under any the transactioncost structure is not significantly different from the MDDwithout transaction cost for MLP DBN and SAE For alltrading algorithms except for MLP DBN and SAE such asLR the MDD under the transaction cost structures (s0 c1)(s1 c0) (s2 c0) (s3 c0) are not significantly different fromthe MDD without transaction cost the MDD under all othertransaction cost structures are significantly greater than theMDD without transaction cost

Through the analysis of the Table 27 performance eval-uation indicators we find that trading performance afterconsidering transaction cost will be worse than that withoutconsidering transaction cost as is in actual trading situationIt is noteworthy that the performance changes of DNNalgorithms especially MLP DBN and SAE are very smallafter considering transaction cost This shows that the threealgorithms have good tolerance to changes of transactioncost Especially for the MDD of the three algorithms thereis no significant difference with that with no transactioncost So we can consider applying them in actual tradingMeanwhile we conclude that the transparent transactioncost has greater impact on the trading performances thanthe slippage for SPICS This is because the prices of SPICSare too high when the transparent transaction cost is setto a certain percentage of turnover In actual transactionsspecial attention needs to be paid to the fact that the trans-action performance under most transaction cost structuresis significantly lower than the trading performance withoutconsidering transaction cost It is worth noting that theperformance of traditional ML algorithm is not worse thanthat ofDNNalgorithmswithout considering transaction costwhile the performance of DNN algorithms is better than thatof traditional ML algorithms after considering transactioncost

63 Analysis of Impact of Transaction Cost on the TradingPerformance of CSICS Similar to Section 62 we will discussthe impact of transaction cost on trading performance ofCSICS in the followings In the Chinese A-share marketthe transparent transaction cost is usually set to a certain

22 Mathematical Problems in Engineering

Table26Th

eASR

ofSP

ICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

1546

815

412

15502

15764

15571

15828

13927

16237

16763

15818

16018

16298

(s0c1)

1456

214

478

14577

1300

012

317

13565

09346

13554

12650

12472

12456

11294

(s0c2)

13639

13527

13635

10191

09015

11262

04657

10822

08482

09074

08846

06236

(s0c3)

12702

12561

12679

07355

05690

08929

-00085

08061

04298

05652

05216

0118

2(s0c4)

11751

11581

11709

04511

02366

06580

-04823

05291

00139

02234

01596

-03812

(s0c5)

1079

10591

10728

01678

-00931

04227

-09500

02534

-039

59-01152

-019

87-08696

(s1c0)

15121

1505

715

149

1492

714

606

15119

1244

915

424

1558

214

825

14974

1488

6(s1c1)

14208

14116

14217

12146

11334

12841

07823

12722

1144

711459

11394

09859

(s1c2)

13279

13159

13270

09325

08020

10526

03105

09977

07267

08048

07772

04792

(s1c3)

12337

12188

12308

064

8204690

08185

-016

4607209

03082

04622

04139

-00257

(s1c4)

11382

11204

11333

03637

01368

05831

-06374

04438

-010

6801208

00524

-052

31(s1c5)

10417

10210

10348

00807

-019

2003478

-110

2501686

-05146

-02169

-0304

7-10083

(s2c0)

1477

1469

914

792

1408

113

632

1440

310

946

1460

114

390

1382

213

922

1346

2(s2c1)

13851

13752

13854

11285

10343

12111

06283

11883

10237

10439

10325

08416

(s2c2)

12916

12789

12901

08454

07021

09785

01547

09128

060

4907019

06696

03346

(s2c3)

11969

11812

11934

05607

03688

07437

-032

0506355

01868

03591

03063

-016

90(s2c4)

11010

10825

10955

02763

00372

05081

-07916

03586

-02268

00183

-00545

-06639

(s2c5)

1004

109827

09967

-0006

-02905

02729

-12533

00841

-06323

-031

79-04101

-114

54(s3c0)

14415

14337

14432

13227

12650

13679

09425

13770

13189

12810

12862

12030

(s3c1)

13490

13384

13488

10419

09348

11375

04733

11039

09023

09413

09252

06971

(s3c2)

12551

12416

12529

07580

060

19090

40-00013

08275

04832

05988

05618

01904

(s3c3)

11599

11435

11558

04731

02688

066

88-04757

05500

00658

02562

01988

-031

16(s3c4)

10636

10443

10575

01891

-00620

04331

-0944

202735

-0346

0-00836

-016

08-08034

(s3c5)

09664

09443

09584

-00924

-03883

01982

-14018

000

00-074

89-04183

-05146

-12808

(s4c0)

14058

13972

1406

812

368

11662

12950

07892

12933

11983

11793

11796

10591

(s4c1)

13127

13013

13119

09549

08350

10634

03180

10190

07807

08386

08177

05527

(s4c2)

12183

1204

12155

06705

05018

08293

-015

6807421

03617

04958

04542

004

68(s4c3)

11226

11055

11179

03857

01691

05938

-06295

046

47-00545

01537

00918

-04529

(s4c4)

1026

1006

10193

01021

-016

0703582

-10948

01888

-0464

2-018

49-02665

-09413

(s4c5)

09286

09057

09199

-017

83-04853

01238

-15478

-00836

-0864

2-05177

-06182

-14142

Mathematical Problems in Engineering 23

Table 27 The MDD of SPICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 03583 03584 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338(s0 c1) 03629 03638 03594 03779 03986 03636 04072 03712 03843 03963 03972 04203(s0 c2) 03677 03695 03647 04302 04707 03968 05168 04127 04842 04729 04787 05735(s0 c3) 03727 03756 03703 04990 05639 04376 06564 04709 06172 05682 05844 07335(s0 c4) 03781 03821 03764 05767 06612 04873 07804 05424 07377 06653 06913 08447(s0 c5) 03839 03890 03828 06529 0746 05444 08730 06162 08272 07501 07808 09118(s1 c0) 03596 03600 03560 03500 036130 03446 03574 03502 03414 03585 03569 03540(s1 c1) 03642 03655 03609 03907 04156 03717 04320 03814 04067 04154 04170 04541(s1 c2) 03691 03712 03662 04466 04936 04066 05534 04270 05172 04971 05049 06168(s1 c3) 03742 03774 03720 05183 05895 04495 06928 04885 06499 05937 06129 07662(s1 c4) 03796 03839 03781 05961 06842 05013 08105 05610 07631 06884 07161 08649(s1 c5) 03856 03909 03847 0671 07646 05595 08946 06342 08451 07691 0800 09235(s2 c0) 03609 03615 03573 03607 03756 03517 03770 03586 03586 03739 03727 03787(s2 c1) 03656 03671 03623 04047 04349 03805 04627 03929 04339 04365 04397 04929(s2 c2) 03705 03729 03678 04642 05176 04171 05916 04424 05504 05218 05327 06577(s2 c3) 03756 03792 03736 05377 06143 04624 07277 05067 06805 06183 06402 07939(s2 c4) 03812 03859 03799 06155 07056 05161 08380 05796 07856 07099 07388 08816(s2 c5) 03873 03930 03866 06887 07816 05751 09126 06517 08606 07864 08172 09331(s3 c0) 03622 03631 03588 03729 03912 03594 04004 03685 03795 03909 03909 04081(s3 c1) 03669 03687 03639 04200 04555 03901 04966 04062 04622 04587 04642 05334(s3 c2) 03719 03746 03694 04826 05423 04286 06295 04589 05833 05465 05607 06936(s3 c3) 03772 03811 03754 05572 06377 04762 07609 05248 07081 06420 06657 08175(s3 c4) 03829 03879 03818 06341 07254 05314 08620 05980 08054 07300 07593 08956(s3 c5) 03894 03954 03888 07056 07972 05909 09275 06689 08740 08022 08325 09412(s4 c0) 03635 03647 03602 03861 04082 03678 04274 03798 04015 04096 04114 04396(s4 c1) 03683 03704 03654 04362 04774 04005 05325 04211 04908 04814 04894 05730(s4 c2) 03734 03765 03712 05013 05664 04410 06667 04758 06142 05707 05875 07253(s4 c3) 03790 03833 03775 05765 06600 04905 07906 05429 07330 06644 06894 08375(s4 c4) 03851 03904 03841 06521 07439 05470 08824 06162 08230 07485 07782 09074(s4 c5) 03917 03981 03913 07218 08115 06067 09395 06857 08858 08165 08463 09480

percentage of turnover and it is the same as the assumptionin the experimental settings As in the US stock market thesmallest unit of price change is 001 (one tick) It is reasonableto set slippage to be 001-005 Of course it should be notedthat the prices fluctuation may be more intense when closingthan that in the middle of a trading day

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 28 the WR is decreasing with the increaseof transaction cost for any trading algorithm When thetransaction cost is set to (s c) = (004 0005) the WR of eachalgorithm is the smallest Comparedwith the settings withouttransaction cost the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR SVM and XGB are reduced by671 688 697 2269 1726 1548 2430 14912484 2112 2112 and 2919 respectively For a generalsetting of s and c ie (s c) = (002 0003) the WR ofMLP DBN and SAE decrease by 410 420 and 430respectively while the WR of other algorithms decrease bymore than 9 the WR of CART RF and XGB decrease by

more than 15 Therefore MLP DBN and SAE are moretolerant to transaction cost From single trading algorithmsuch as LSTM if we do not consider slippage ie s=0 theaverage WR of DBN is 05417 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage WR of LSTM is 05304 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the WR under the transactioncost structures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the WR without transaction cost for MLPDBN SAE and NB the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN SAE and NB the WR under the transaction coststructure (s0 c1) is not significantly different from the WRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

24 Mathematical Problems in Engineering

Table 28 The WR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803(s0 c1) 05523 05527 05525 05525 05608 05620 05009 05227 05612 05665 05571 05595(s0 c2) 05488 05492 05489 05389 05512 05535 04879 05149 05460 05542 05445 05411(s0 c3) 05453 05456 05452 05258 05414 05451 04747 05068 05313 05418 05320 05234(s0 c4) 05417 05419 05414 05127 05320 05368 04622 04991 05172 05297 05202 05067(s0 c5) 05383 05383 05379 05004 05230 05286 04504 04917 05036 05180 05088 04905(s1 c0) 05494 05499 05497 05444 05541 05558 04925 05170 05520 05584 05492 05488(s1 c1) 05456 05459 05456 05286 05424 05456 04775 05080 05342 05437 05345 05275(s1 c2) 05421 05423 05420 05161 05335 05377 04654 05007 05207 05320 05231 05110(s1 c3) 05386 05388 05383 05036 05246 05296 04530 04931 05065 05205 05116 04946(s1 c4) 05353 05354 05349 04915 05156 05218 04419 04861 04937 05095 05007 04795(s1 c5) 05323 05323 05317 04808 05076 05148 04315 04796 04817 04995 04905 04652(s2 c0) 05431 05434 05431 05219 05368 05403 04707 05036 05269 05374 05286 05189(s2 c1) 05395 05397 05393 05078 05266 05314 04573 04956 05115 05242 05154 05005(s2 c2) 05360 05361 05357 04960 05181 05237 04458 04886 04985 05134 05046 04853(s2 c3) 05331 05331 05326 04850 05100 05167 04352 04818 04864 05031 04945 04711(s2 c4) 05300 05300 05293 04743 05018 05093 04252 04752 04746 04931 04846 04572(s2 c5) 05273 05271 05266 04648 04946 05029 04159 04692 04639 04838 04755 04445(s3 c0) 05373 05374 05371 05019 05216 05265 04514 04917 05049 05186 05098 04932(s3 c1) 05341 05341 05336 04902 05128 05188 04399 04846 04917 05074 04990 04775(s3 c2) 05312 05312 05306 04798 05052 05122 04303 04782 04804 04977 04896 04644(s3 c3) 05281 05281 05275 04696 04976 05049 04206 04718 04689 04879 04799 04509(s3 c4) 05252 05251 05245 04598 04901 04984 04110 04657 04581 04785 04707 04378(s3 c5) 05226 05223 05218 04510 04833 04924 04023 04602 04481 04701 04621 04264(s4 c0) 05325 05325 05321 04860 05089 05150 04360 04816 04870 05030 04949 04723(s4 c1) 05294 05294 05289 04753 05010 05079 04258 04750 04752 04928 04849 04588(s4 c2) 05266 05265 05259 04653 04937 05013 04164 04690 04642 04838 04761 04458(s4 c3) 05238 05236 05230 04562 04864 04948 04073 04632 04541 04747 04672 04336(s4 c4) 05211 05208 05203 04475 04798 04891 03985 04577 04440 04662 04586 04218(s4 c5) 05186 05182 05176 04392 04733 04832 03901 04524 04348 04582 04509 04109

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 29 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the smallest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 5073 5175 and 5225 respectivelyWhile the ARR of other trading algorithms decrease bymore than 100 compared with those algorithms withouttransaction cost Therefore excessive transaction cost canlead to serious losses in the accounts For a general settingof s and c ie (s c) = (002 0003) ARR of MLP DBNand SAE decrease by 2741 2797 and 2825 respectivelywhile the ARR other algorithms decrease by more than 50and that of CART NB RF and XGB decrease by more than100 Therefore MLP DBN and SAE are more tolerant totransaction cost From single trading algorithm such as SAEif we do not consider slippage ie s=0 the average ARR ofSAE is 05040 under the transaction cost structure (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not consider

transparent transaction cost ie c=0 the averageARRof SAEis 04468 under the transaction cost structures (s1 c0) (s2c0) (s3 c0) (s4 c0) so transparent transaction cost hassmaller impact than slippage Through multiple comparativeanalysis the ARR under the transaction cost structures (s0c1) (s0 c2) (s0 c3) (s0 c1) (s1 c1) are not significantlydifferent from the ARR without transaction cost for MLPDBN and SAE the ARR under all other transaction coststructures are significantly smaller than the ARR withouttransaction cost For RNN LSTM GRU CART RF LR andSVM the ARR under the transaction cost structures (s0c1) (s0 c2) (s1 c0) are not significantly different fromthe ARR without transaction cost the ARR under all othertransaction cost structures are significantly smaller than theARR without transaction cost For NB and XGB the ARRunder the transaction cost structures (s0 c1) (s1 c0) arenot significantly different from the ARR without transactioncost the ARR under all other transaction cost structuresare significantly smaller than the ARR without transactioncost

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 18: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

18 Mathematical Problems in Engineering

Input TS TS is trading signals of a stocks s is slippagec c is transparent transaction cost

Output WR ARR ASR MDD(1) N=length of Stock Code List 424 SPICS and 185 CSICS(2) WR=NULL ARR=NULL ASR=NULL MDD=NULL(3) for (i in 1 N) (4) Stock Data=Stock Code List[i](5) ClosePricet=Stock Data [ldquoClosing Pricerdquo](6) Pt =ClosePricet lowast(1-clowastabs(TSt-TSt-1)) - slowastabs(TSt-TSt-1)(7) Pt-1 =ClosePricetlowast(1+clowastabs(TSt-TSt-1)) + slowastabs(TSt-TSt-1)(8) Rett= (Pt- Pt-1) Pt Ret is the return rate series(9) TDRR=lag (TS)lowastRet TDRR is the daily return through trading(10) WR[i]=sum (TDRRgt0)sum(TDRR =0)(11) ARR[i]=Returnannualized (TDRR)(12) ASR[i]=SharpeRatioannualized (TDRR)(13) MDD[i]=maxDrawDown (TDRR)(14) WR=c (WR WR[i])(15) ARR=c (ARR ARR[i])(16) ASR=c (ASR ASR[i])(17) MDD=c (MDD MDD[i])(18) (19) return (WR ARR ASR MDD)

Algorithm 3 Backtesting algorithm with transaction cost in R language

62 Analysis of Impact of Transaction Cost on the TradingPerformance of SPICS Transaction cost is one of the mostimportant factors affecting trading performance In US stocktrading transparent transaction cost can be charged accord-ing to a fixed fee per order or month or a floating fee basedon the volume and turnover of each transaction Sometimescustomers can also negotiate with broker to determinetransaction cost The transaction cost charged by differentbrokers varies greatly Meanwhile implicit transaction costis not known beforehand and the estimations of them arevery complex Therefore we assume that the percentageof turnover is the transparent transaction cost for ease ofcalculation In the aspect of implicit transaction cost we onlyconsider the impact of slippage on trading performance

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 24 WR is decreasing with the increase oftransaction cost for any trading algorithm which is intuitiveWhen the transaction cost is set to (s c) = (004 0005) theWR of each algorithm is the lowest Compared with setting(s c) = (0 0) the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR and SVM to XGB are reduced by580 597 591 1583 1804 1395 2171 16042216 1854 1850 and 2597 respectively ThereforeMLP DBN and SAE are more tolerant to transaction costGenerally speaking the DNN models have stronger capacityto accommodate transaction cost than the traditional MLmodels From the single trading algorithm such as MLP ifwe do not consider slippage ie s=0 the average WR ofMLP is 05510 under transaction cost structures (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not considertransparent transaction cost ie c=0 the averageWRofMLP

is 05618 under transaction cost structures (s1 c0) (s2 c0)(s3 c0) (s4 c0) so transparent transaction cost has greaterimpact than slippageThroughmultiple comparative analysisthe WR under the transaction cost structure (s1 c0) is notsignificantly different from the WR without transaction costfor MLP DBN and SAETheWR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the WR under the transaction cost structure (s1 c0) (s2 c0) are not significantly different from theWRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 25 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the lowest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 4031 4157 and 4093 respectivelywhile the ARR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin accounts For a general setting of s and c ie (s c) = (0020003) ARR of MLP DBN and SAE decrease by 23262400 and 2361 respectively while the ARR of otheralgorithms decrease by more than 50 and that of CARTand XGB decrease bymore than 100ThereforeMLP DBNand SAE are more tolerant to high transaction cost Fromsingle trading algorithm such as RNN if we do not considerslippage ie s=0 the average ARR of RNN is 01434 under

Mathematical Problems in Engineering 19

Table24Th

eWRof

SPICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

05676

05680

05683

05843

05825

05844

05266

05930

05912

05859

05831

05891

(s0c1)

05615

05618

05621

05669

05626

05694

05052

05752

05663

05654

05630

05599

(s0c2)

05560

05560

05564

05507

05442

05553

04847

05585

05429

05463

05438

05324

(s0c3)

05507

05506

05510

05353

05269

05418

04652

05424

05205

05278

05253

05061

(s0c4)

05457

05454

05460

05206

05101

05289

044

7005277

04996

05105

05084

04818

(s0c5)

05410

05407

05412

05071

04946

05170

04303

05138

04803

04947

04924

04594

(s1c0)

056

49056

53056

5605778

05751

05785

05190

058

61058

2405782

05759

05788

(s1c1)

05594

05597

05600

05619

05571

05648

04991

05700

05597

05595

05574

05521

(s1c2)

05539

05539

05544

05458

05389

05508

04788

05534

05364

05406

05383

05249

(s1c3)

05487

05486

05491

05305

05215

05375

04597

05375

05141

05223

05200

04988

(s1c4)

05438

05436

05441

05163

05052

05249

044

1805231

04938

05054

05034

04750

(s1c5)

05394

05390

05396

05032

04902

05132

04255

05097

04751

04900

04880

04532

(s2c0)

05628

05631

05635

05729

056

9705741

05134

058

1105758

05726

05704

05713

(s2c1)

05573

05574

05578

05568

05515

05602

04931

05647

05527

05535

05515

05442

(s2c2)

05518

05518

05523

05408

05336

05463

04729

05482

05297

05349

05326

05172

(s2c3)

05469

05467

05472

05260

05164

05334

04543

05330

05082

05171

05150

04918

(s2c4)

05421

05417

05423

05120

05004

05209

04368

05187

04881

05004

04986

046

85(s2c5)

05377

05373

05379

04993

04858

05096

04209

05055

04699

04855

04835

044

73(s3c0)

05606

05609

05612

05678

05640

05694

05074

05759

05690

05668

05646

05635

(s3c1)

05552

05553

05558

05518

05460

05556

04872

05595

05460

05478

05459

05365

(s3c2)

05499

05498

05503

05362

05284

05422

046

7505434

05233

05295

05273

05099

(s3c3)

05450

05448

05453

05216

05114

05292

04491

05284

05020

05120

05098

04849

(s3c4)

05405

05401

05407

05080

04960

05172

04321

05146

04827

04959

04940

04622

(s3c5)

05362

05357

05363

04955

04816

05063

04166

05017

04651

04815

04793

044

17(s4c0)

05587

05589

05593

05630

05588

05652

05019

05710

05627

05613

05593

05562

(s4c1)

05533

05533

05537

05470

05407

05513

04815

05544

05395

05424

05404

05290

(s4c2)

05480

05479

05484

05316

05232

05380

04620

05386

05171

05242

05220

05026

(s4c3)

05432

05429

05435

05172

05067

05253

044

4005241

04964

05070

05051

04782

(s4c4)

05388

05384

05391

05041

04917

05137

04274

05106

04775

04914

04897

04564

(s4c5)

05347

05341

05347

04918

04774

05029

04123

04979

046

0204773

04752

04361

20 Mathematical Problems in Engineering

Table25Th

eARR

ofSP

ICSford

ailytradingwith

different

transactioncost

Ther

esultthatthere

isno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

03332

03296

03325

02943

02920

02934

03317

02975

03133

02942

03067

03041

(s0c1)

03128

030

8703118

02439

02327

02521

02266

02496

02384

02336

02400

02137

(s0c2)

02924

02879

02912

01936

01735

02108

01216

02017

01636

01731

01734

01234

(s0c3)

02721

02672

02706

01433

0114

301697

00168

01539

00889

01126

01070

00333

(s0c4)

02519

02464

02500

00931

00553

01285

-00878

01062

00143

00522

004

06-00567

(s0c5)

02316

02257

02294

00430

-00037

00875

-019

2400586

-00602

-0008

-00257

-014

66(s1c0)

03249

03212

03242

027

7802729

02794

029

53028

18028

9802747

028

5502762

(s1c1)

03046

03004

03035

02274

02136

02381

01902

02339

02149

02141

02188

01859

(s1c2)

02842

02796

02829

01771

01544

01969

00853

01861

01401

01536

01523

00957

(s1c3)

02639

02588

02623

01269

00953

01557

-00195

01383

00654

00931

00858

000

56(s1c4)

02437

02381

02417

00767

00363

0114

6-012

41009

06-00091

00328

00195

-00844

(s1c5)

02234

02174

02211

00266

-00226

00735

-02285

00430

-00836

-00275

-0046

8-01742

(s2c0)

03167

03129

03159

026

1302538

026

54025

89026

61026

6302551

026

43024

84(s2c1)

02964

02921

02952

02110

01946

02241

01539

02182

01914

01946

01977

01581

(s2c2)

0276

02713

02746

01607

01354

01829

00490

01704

0116

701341

01312

006

79(s2c3)

02557

02505

02540

0110

400763

01418

-00557

01227

004

2000737

006

47-00221

(s2c4)

02355

02298

02334

006

0300173

01007

-016

0300750

-00325

00134

-00016

-01120

(s2c5)

02153

02091

02129

00102

-00416

00597

-0264

700274

-010

69-00469

-00678

-02018

(s3c0)

030

85030

46030

7602448

02348

02514

02225

02504

02428

02356

02431

02206

(s3c1)

02881

02838

02869

01945

01756

02102

0117

502026

01680

01751

01765

01304

(s3c2)

02678

02630

02663

01442

01164

01690

00127

01548

00933

0114

601100

004

02(s3c3)

02476

02422

02457

00940

00574

01279

-00919

01071

00187

00543

00436

-00498

(s3c4)

02273

02215

02252

00439

-00016

00868

-019

6400595

-00558

-0006

-00227

-013

97(s3c5)

02071

02008

02047

-00062

-0060

5004

58-0300

800119

-013

02-00662

-00889

-02294

(s4c0)

03003

02962

02993

02284

02157

02374

01862

02348

02193

02161

02219

01929

(s4c1)

02799

02754

02786

01781

01565

01962

00813

01870

01445

01556

01554

01026

(s4c2)

02597

02547

02580

01278

00974

01551

-00235

01392

00699

00952

00889

00125

(s4c3)

02394

02339

02375

00776

00384

0114

0-012

8100915

-0004

700349

00226

-00774

(s4c4)

02192

02132

02169

00275

-00205

00729

-02326

00439

-00792

-00254

-00437

-016

73(s4c5)

01989

01926

01964

-00225

-00794

00319

-033

69-00037

-015

35-00856

-010

99-02570

Mathematical Problems in Engineering 21

the transaction cost structures (s0 c1) (s0 c2) (s0 c3) (s0c4) (s0 c5) if we do not consider transparent transactioncost ie c=0 the average ARR of RNN is 02531 under thetransaction cost structure (s1 c0) (s2 c0) (s3 c0) (s4c0) so transparent transaction cost has greater impact thanslippage Through multiple comparative analysis the ARRunder the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s0 c1) are not significantly different from the ARRwithout transaction cost for MLP DBN and SAE the ARRunder all other transaction cost structures are significantlysmaller than theARRwithout transaction cost For all tradingalgorithms except for MLP DBN and SAE the ARR underthe transaction cost structures (s1 c0) (s2 c0) are notsignificantly different from the ARR without transactioncost the ARR under all other transaction cost structures aresignificantly smaller than the ARR without transaction cost

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 26 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theASR of each algorithm is the lowest Compared with settingwithout transaction cost the ASR of MLP DBN and SAEreduce by 3997 4123 and 4066 respectively while theASR of other trading algorithms reduce by more than 90compared with the case of no transaction cost Thereforeexcessive transaction cost will significantly reduce ASR Fora general setting of s and c ie (s c) = (002 0003) theASR of MLP DBN and SAE decrease by 2262 2336and 2302 respectively while the ASR of other algorithmsdecrease by more than 50 the ASR of CART and XGBdecrease by more than 100Therefore MLP DBN and SAEare more tolerant to transaction cost From single tradingalgorithm such as NB if we do not consider slippage ies=0 the average ASR of NB is 08052 under the transactioncost structure (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5)if we do not consider transparent transaction cost ie c=0the average ASR of NB is 14182 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has greater impact than slippage Throughmultiple comparative analysis the ASR under the transactioncost structures (s1 c0) (s2 c0) (s3 c0) (s0 c1) are notsignificantly different from the ASR without transaction costfor MLP DBN and SAE the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the ASR under the transaction cost structures(s1 c0) (s2 c0) are not significantly different from the ASRwithout transaction cost the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 27 MDD increases with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the settings without transaction cost theMDD of MLP DBN and SAE increase by 932 1108 and

1032 respectively The MDD of other trading algorithmsincrease by more than 80 compared with those withoutconsidering transaction costTherefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 483 580 and 533respectively while the MDD of other algorithms increase bymore than 35 and theMDDofCART RF andXGB increasebymore than 100Therefore MLP DBN and SAE are moretolerant to transaction cost As awhole theDNNmodels havestronger capacity to accommodate transaction cost than thetraditional ML models From single trading algorithm suchas GRU if we do not consider slippage ie s=0 the averageMDD of GRU is 04459 under the transaction cost structures(s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do notconsider transparent transaction cost ie c=0 the averageMDD of GRU is 03559 under the transaction cost structures(s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparent transactioncost has greater impact than slippage Through multiplecomparative analysis the MDD under any the transactioncost structure is not significantly different from the MDDwithout transaction cost for MLP DBN and SAE For alltrading algorithms except for MLP DBN and SAE such asLR the MDD under the transaction cost structures (s0 c1)(s1 c0) (s2 c0) (s3 c0) are not significantly different fromthe MDD without transaction cost the MDD under all othertransaction cost structures are significantly greater than theMDD without transaction cost

Through the analysis of the Table 27 performance eval-uation indicators we find that trading performance afterconsidering transaction cost will be worse than that withoutconsidering transaction cost as is in actual trading situationIt is noteworthy that the performance changes of DNNalgorithms especially MLP DBN and SAE are very smallafter considering transaction cost This shows that the threealgorithms have good tolerance to changes of transactioncost Especially for the MDD of the three algorithms thereis no significant difference with that with no transactioncost So we can consider applying them in actual tradingMeanwhile we conclude that the transparent transactioncost has greater impact on the trading performances thanthe slippage for SPICS This is because the prices of SPICSare too high when the transparent transaction cost is setto a certain percentage of turnover In actual transactionsspecial attention needs to be paid to the fact that the trans-action performance under most transaction cost structuresis significantly lower than the trading performance withoutconsidering transaction cost It is worth noting that theperformance of traditional ML algorithm is not worse thanthat ofDNNalgorithmswithout considering transaction costwhile the performance of DNN algorithms is better than thatof traditional ML algorithms after considering transactioncost

63 Analysis of Impact of Transaction Cost on the TradingPerformance of CSICS Similar to Section 62 we will discussthe impact of transaction cost on trading performance ofCSICS in the followings In the Chinese A-share marketthe transparent transaction cost is usually set to a certain

22 Mathematical Problems in Engineering

Table26Th

eASR

ofSP

ICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

1546

815

412

15502

15764

15571

15828

13927

16237

16763

15818

16018

16298

(s0c1)

1456

214

478

14577

1300

012

317

13565

09346

13554

12650

12472

12456

11294

(s0c2)

13639

13527

13635

10191

09015

11262

04657

10822

08482

09074

08846

06236

(s0c3)

12702

12561

12679

07355

05690

08929

-00085

08061

04298

05652

05216

0118

2(s0c4)

11751

11581

11709

04511

02366

06580

-04823

05291

00139

02234

01596

-03812

(s0c5)

1079

10591

10728

01678

-00931

04227

-09500

02534

-039

59-01152

-019

87-08696

(s1c0)

15121

1505

715

149

1492

714

606

15119

1244

915

424

1558

214

825

14974

1488

6(s1c1)

14208

14116

14217

12146

11334

12841

07823

12722

1144

711459

11394

09859

(s1c2)

13279

13159

13270

09325

08020

10526

03105

09977

07267

08048

07772

04792

(s1c3)

12337

12188

12308

064

8204690

08185

-016

4607209

03082

04622

04139

-00257

(s1c4)

11382

11204

11333

03637

01368

05831

-06374

04438

-010

6801208

00524

-052

31(s1c5)

10417

10210

10348

00807

-019

2003478

-110

2501686

-05146

-02169

-0304

7-10083

(s2c0)

1477

1469

914

792

1408

113

632

1440

310

946

1460

114

390

1382

213

922

1346

2(s2c1)

13851

13752

13854

11285

10343

12111

06283

11883

10237

10439

10325

08416

(s2c2)

12916

12789

12901

08454

07021

09785

01547

09128

060

4907019

06696

03346

(s2c3)

11969

11812

11934

05607

03688

07437

-032

0506355

01868

03591

03063

-016

90(s2c4)

11010

10825

10955

02763

00372

05081

-07916

03586

-02268

00183

-00545

-06639

(s2c5)

1004

109827

09967

-0006

-02905

02729

-12533

00841

-06323

-031

79-04101

-114

54(s3c0)

14415

14337

14432

13227

12650

13679

09425

13770

13189

12810

12862

12030

(s3c1)

13490

13384

13488

10419

09348

11375

04733

11039

09023

09413

09252

06971

(s3c2)

12551

12416

12529

07580

060

19090

40-00013

08275

04832

05988

05618

01904

(s3c3)

11599

11435

11558

04731

02688

066

88-04757

05500

00658

02562

01988

-031

16(s3c4)

10636

10443

10575

01891

-00620

04331

-0944

202735

-0346

0-00836

-016

08-08034

(s3c5)

09664

09443

09584

-00924

-03883

01982

-14018

000

00-074

89-04183

-05146

-12808

(s4c0)

14058

13972

1406

812

368

11662

12950

07892

12933

11983

11793

11796

10591

(s4c1)

13127

13013

13119

09549

08350

10634

03180

10190

07807

08386

08177

05527

(s4c2)

12183

1204

12155

06705

05018

08293

-015

6807421

03617

04958

04542

004

68(s4c3)

11226

11055

11179

03857

01691

05938

-06295

046

47-00545

01537

00918

-04529

(s4c4)

1026

1006

10193

01021

-016

0703582

-10948

01888

-0464

2-018

49-02665

-09413

(s4c5)

09286

09057

09199

-017

83-04853

01238

-15478

-00836

-0864

2-05177

-06182

-14142

Mathematical Problems in Engineering 23

Table 27 The MDD of SPICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 03583 03584 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338(s0 c1) 03629 03638 03594 03779 03986 03636 04072 03712 03843 03963 03972 04203(s0 c2) 03677 03695 03647 04302 04707 03968 05168 04127 04842 04729 04787 05735(s0 c3) 03727 03756 03703 04990 05639 04376 06564 04709 06172 05682 05844 07335(s0 c4) 03781 03821 03764 05767 06612 04873 07804 05424 07377 06653 06913 08447(s0 c5) 03839 03890 03828 06529 0746 05444 08730 06162 08272 07501 07808 09118(s1 c0) 03596 03600 03560 03500 036130 03446 03574 03502 03414 03585 03569 03540(s1 c1) 03642 03655 03609 03907 04156 03717 04320 03814 04067 04154 04170 04541(s1 c2) 03691 03712 03662 04466 04936 04066 05534 04270 05172 04971 05049 06168(s1 c3) 03742 03774 03720 05183 05895 04495 06928 04885 06499 05937 06129 07662(s1 c4) 03796 03839 03781 05961 06842 05013 08105 05610 07631 06884 07161 08649(s1 c5) 03856 03909 03847 0671 07646 05595 08946 06342 08451 07691 0800 09235(s2 c0) 03609 03615 03573 03607 03756 03517 03770 03586 03586 03739 03727 03787(s2 c1) 03656 03671 03623 04047 04349 03805 04627 03929 04339 04365 04397 04929(s2 c2) 03705 03729 03678 04642 05176 04171 05916 04424 05504 05218 05327 06577(s2 c3) 03756 03792 03736 05377 06143 04624 07277 05067 06805 06183 06402 07939(s2 c4) 03812 03859 03799 06155 07056 05161 08380 05796 07856 07099 07388 08816(s2 c5) 03873 03930 03866 06887 07816 05751 09126 06517 08606 07864 08172 09331(s3 c0) 03622 03631 03588 03729 03912 03594 04004 03685 03795 03909 03909 04081(s3 c1) 03669 03687 03639 04200 04555 03901 04966 04062 04622 04587 04642 05334(s3 c2) 03719 03746 03694 04826 05423 04286 06295 04589 05833 05465 05607 06936(s3 c3) 03772 03811 03754 05572 06377 04762 07609 05248 07081 06420 06657 08175(s3 c4) 03829 03879 03818 06341 07254 05314 08620 05980 08054 07300 07593 08956(s3 c5) 03894 03954 03888 07056 07972 05909 09275 06689 08740 08022 08325 09412(s4 c0) 03635 03647 03602 03861 04082 03678 04274 03798 04015 04096 04114 04396(s4 c1) 03683 03704 03654 04362 04774 04005 05325 04211 04908 04814 04894 05730(s4 c2) 03734 03765 03712 05013 05664 04410 06667 04758 06142 05707 05875 07253(s4 c3) 03790 03833 03775 05765 06600 04905 07906 05429 07330 06644 06894 08375(s4 c4) 03851 03904 03841 06521 07439 05470 08824 06162 08230 07485 07782 09074(s4 c5) 03917 03981 03913 07218 08115 06067 09395 06857 08858 08165 08463 09480

percentage of turnover and it is the same as the assumptionin the experimental settings As in the US stock market thesmallest unit of price change is 001 (one tick) It is reasonableto set slippage to be 001-005 Of course it should be notedthat the prices fluctuation may be more intense when closingthan that in the middle of a trading day

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 28 the WR is decreasing with the increaseof transaction cost for any trading algorithm When thetransaction cost is set to (s c) = (004 0005) the WR of eachalgorithm is the smallest Comparedwith the settings withouttransaction cost the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR SVM and XGB are reduced by671 688 697 2269 1726 1548 2430 14912484 2112 2112 and 2919 respectively For a generalsetting of s and c ie (s c) = (002 0003) the WR ofMLP DBN and SAE decrease by 410 420 and 430respectively while the WR of other algorithms decrease bymore than 9 the WR of CART RF and XGB decrease by

more than 15 Therefore MLP DBN and SAE are moretolerant to transaction cost From single trading algorithmsuch as LSTM if we do not consider slippage ie s=0 theaverage WR of DBN is 05417 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage WR of LSTM is 05304 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the WR under the transactioncost structures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the WR without transaction cost for MLPDBN SAE and NB the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN SAE and NB the WR under the transaction coststructure (s0 c1) is not significantly different from the WRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

24 Mathematical Problems in Engineering

Table 28 The WR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803(s0 c1) 05523 05527 05525 05525 05608 05620 05009 05227 05612 05665 05571 05595(s0 c2) 05488 05492 05489 05389 05512 05535 04879 05149 05460 05542 05445 05411(s0 c3) 05453 05456 05452 05258 05414 05451 04747 05068 05313 05418 05320 05234(s0 c4) 05417 05419 05414 05127 05320 05368 04622 04991 05172 05297 05202 05067(s0 c5) 05383 05383 05379 05004 05230 05286 04504 04917 05036 05180 05088 04905(s1 c0) 05494 05499 05497 05444 05541 05558 04925 05170 05520 05584 05492 05488(s1 c1) 05456 05459 05456 05286 05424 05456 04775 05080 05342 05437 05345 05275(s1 c2) 05421 05423 05420 05161 05335 05377 04654 05007 05207 05320 05231 05110(s1 c3) 05386 05388 05383 05036 05246 05296 04530 04931 05065 05205 05116 04946(s1 c4) 05353 05354 05349 04915 05156 05218 04419 04861 04937 05095 05007 04795(s1 c5) 05323 05323 05317 04808 05076 05148 04315 04796 04817 04995 04905 04652(s2 c0) 05431 05434 05431 05219 05368 05403 04707 05036 05269 05374 05286 05189(s2 c1) 05395 05397 05393 05078 05266 05314 04573 04956 05115 05242 05154 05005(s2 c2) 05360 05361 05357 04960 05181 05237 04458 04886 04985 05134 05046 04853(s2 c3) 05331 05331 05326 04850 05100 05167 04352 04818 04864 05031 04945 04711(s2 c4) 05300 05300 05293 04743 05018 05093 04252 04752 04746 04931 04846 04572(s2 c5) 05273 05271 05266 04648 04946 05029 04159 04692 04639 04838 04755 04445(s3 c0) 05373 05374 05371 05019 05216 05265 04514 04917 05049 05186 05098 04932(s3 c1) 05341 05341 05336 04902 05128 05188 04399 04846 04917 05074 04990 04775(s3 c2) 05312 05312 05306 04798 05052 05122 04303 04782 04804 04977 04896 04644(s3 c3) 05281 05281 05275 04696 04976 05049 04206 04718 04689 04879 04799 04509(s3 c4) 05252 05251 05245 04598 04901 04984 04110 04657 04581 04785 04707 04378(s3 c5) 05226 05223 05218 04510 04833 04924 04023 04602 04481 04701 04621 04264(s4 c0) 05325 05325 05321 04860 05089 05150 04360 04816 04870 05030 04949 04723(s4 c1) 05294 05294 05289 04753 05010 05079 04258 04750 04752 04928 04849 04588(s4 c2) 05266 05265 05259 04653 04937 05013 04164 04690 04642 04838 04761 04458(s4 c3) 05238 05236 05230 04562 04864 04948 04073 04632 04541 04747 04672 04336(s4 c4) 05211 05208 05203 04475 04798 04891 03985 04577 04440 04662 04586 04218(s4 c5) 05186 05182 05176 04392 04733 04832 03901 04524 04348 04582 04509 04109

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 29 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the smallest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 5073 5175 and 5225 respectivelyWhile the ARR of other trading algorithms decrease bymore than 100 compared with those algorithms withouttransaction cost Therefore excessive transaction cost canlead to serious losses in the accounts For a general settingof s and c ie (s c) = (002 0003) ARR of MLP DBNand SAE decrease by 2741 2797 and 2825 respectivelywhile the ARR other algorithms decrease by more than 50and that of CART NB RF and XGB decrease by more than100 Therefore MLP DBN and SAE are more tolerant totransaction cost From single trading algorithm such as SAEif we do not consider slippage ie s=0 the average ARR ofSAE is 05040 under the transaction cost structure (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not consider

transparent transaction cost ie c=0 the averageARRof SAEis 04468 under the transaction cost structures (s1 c0) (s2c0) (s3 c0) (s4 c0) so transparent transaction cost hassmaller impact than slippage Through multiple comparativeanalysis the ARR under the transaction cost structures (s0c1) (s0 c2) (s0 c3) (s0 c1) (s1 c1) are not significantlydifferent from the ARR without transaction cost for MLPDBN and SAE the ARR under all other transaction coststructures are significantly smaller than the ARR withouttransaction cost For RNN LSTM GRU CART RF LR andSVM the ARR under the transaction cost structures (s0c1) (s0 c2) (s1 c0) are not significantly different fromthe ARR without transaction cost the ARR under all othertransaction cost structures are significantly smaller than theARR without transaction cost For NB and XGB the ARRunder the transaction cost structures (s0 c1) (s1 c0) arenot significantly different from the ARR without transactioncost the ARR under all other transaction cost structuresare significantly smaller than the ARR without transactioncost

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 19: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

Mathematical Problems in Engineering 19

Table24Th

eWRof

SPICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

05676

05680

05683

05843

05825

05844

05266

05930

05912

05859

05831

05891

(s0c1)

05615

05618

05621

05669

05626

05694

05052

05752

05663

05654

05630

05599

(s0c2)

05560

05560

05564

05507

05442

05553

04847

05585

05429

05463

05438

05324

(s0c3)

05507

05506

05510

05353

05269

05418

04652

05424

05205

05278

05253

05061

(s0c4)

05457

05454

05460

05206

05101

05289

044

7005277

04996

05105

05084

04818

(s0c5)

05410

05407

05412

05071

04946

05170

04303

05138

04803

04947

04924

04594

(s1c0)

056

49056

53056

5605778

05751

05785

05190

058

61058

2405782

05759

05788

(s1c1)

05594

05597

05600

05619

05571

05648

04991

05700

05597

05595

05574

05521

(s1c2)

05539

05539

05544

05458

05389

05508

04788

05534

05364

05406

05383

05249

(s1c3)

05487

05486

05491

05305

05215

05375

04597

05375

05141

05223

05200

04988

(s1c4)

05438

05436

05441

05163

05052

05249

044

1805231

04938

05054

05034

04750

(s1c5)

05394

05390

05396

05032

04902

05132

04255

05097

04751

04900

04880

04532

(s2c0)

05628

05631

05635

05729

056

9705741

05134

058

1105758

05726

05704

05713

(s2c1)

05573

05574

05578

05568

05515

05602

04931

05647

05527

05535

05515

05442

(s2c2)

05518

05518

05523

05408

05336

05463

04729

05482

05297

05349

05326

05172

(s2c3)

05469

05467

05472

05260

05164

05334

04543

05330

05082

05171

05150

04918

(s2c4)

05421

05417

05423

05120

05004

05209

04368

05187

04881

05004

04986

046

85(s2c5)

05377

05373

05379

04993

04858

05096

04209

05055

04699

04855

04835

044

73(s3c0)

05606

05609

05612

05678

05640

05694

05074

05759

05690

05668

05646

05635

(s3c1)

05552

05553

05558

05518

05460

05556

04872

05595

05460

05478

05459

05365

(s3c2)

05499

05498

05503

05362

05284

05422

046

7505434

05233

05295

05273

05099

(s3c3)

05450

05448

05453

05216

05114

05292

04491

05284

05020

05120

05098

04849

(s3c4)

05405

05401

05407

05080

04960

05172

04321

05146

04827

04959

04940

04622

(s3c5)

05362

05357

05363

04955

04816

05063

04166

05017

04651

04815

04793

044

17(s4c0)

05587

05589

05593

05630

05588

05652

05019

05710

05627

05613

05593

05562

(s4c1)

05533

05533

05537

05470

05407

05513

04815

05544

05395

05424

05404

05290

(s4c2)

05480

05479

05484

05316

05232

05380

04620

05386

05171

05242

05220

05026

(s4c3)

05432

05429

05435

05172

05067

05253

044

4005241

04964

05070

05051

04782

(s4c4)

05388

05384

05391

05041

04917

05137

04274

05106

04775

04914

04897

04564

(s4c5)

05347

05341

05347

04918

04774

05029

04123

04979

046

0204773

04752

04361

20 Mathematical Problems in Engineering

Table25Th

eARR

ofSP

ICSford

ailytradingwith

different

transactioncost

Ther

esultthatthere

isno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

03332

03296

03325

02943

02920

02934

03317

02975

03133

02942

03067

03041

(s0c1)

03128

030

8703118

02439

02327

02521

02266

02496

02384

02336

02400

02137

(s0c2)

02924

02879

02912

01936

01735

02108

01216

02017

01636

01731

01734

01234

(s0c3)

02721

02672

02706

01433

0114

301697

00168

01539

00889

01126

01070

00333

(s0c4)

02519

02464

02500

00931

00553

01285

-00878

01062

00143

00522

004

06-00567

(s0c5)

02316

02257

02294

00430

-00037

00875

-019

2400586

-00602

-0008

-00257

-014

66(s1c0)

03249

03212

03242

027

7802729

02794

029

53028

18028

9802747

028

5502762

(s1c1)

03046

03004

03035

02274

02136

02381

01902

02339

02149

02141

02188

01859

(s1c2)

02842

02796

02829

01771

01544

01969

00853

01861

01401

01536

01523

00957

(s1c3)

02639

02588

02623

01269

00953

01557

-00195

01383

00654

00931

00858

000

56(s1c4)

02437

02381

02417

00767

00363

0114

6-012

41009

06-00091

00328

00195

-00844

(s1c5)

02234

02174

02211

00266

-00226

00735

-02285

00430

-00836

-00275

-0046

8-01742

(s2c0)

03167

03129

03159

026

1302538

026

54025

89026

61026

6302551

026

43024

84(s2c1)

02964

02921

02952

02110

01946

02241

01539

02182

01914

01946

01977

01581

(s2c2)

0276

02713

02746

01607

01354

01829

00490

01704

0116

701341

01312

006

79(s2c3)

02557

02505

02540

0110

400763

01418

-00557

01227

004

2000737

006

47-00221

(s2c4)

02355

02298

02334

006

0300173

01007

-016

0300750

-00325

00134

-00016

-01120

(s2c5)

02153

02091

02129

00102

-00416

00597

-0264

700274

-010

69-00469

-00678

-02018

(s3c0)

030

85030

46030

7602448

02348

02514

02225

02504

02428

02356

02431

02206

(s3c1)

02881

02838

02869

01945

01756

02102

0117

502026

01680

01751

01765

01304

(s3c2)

02678

02630

02663

01442

01164

01690

00127

01548

00933

0114

601100

004

02(s3c3)

02476

02422

02457

00940

00574

01279

-00919

01071

00187

00543

00436

-00498

(s3c4)

02273

02215

02252

00439

-00016

00868

-019

6400595

-00558

-0006

-00227

-013

97(s3c5)

02071

02008

02047

-00062

-0060

5004

58-0300

800119

-013

02-00662

-00889

-02294

(s4c0)

03003

02962

02993

02284

02157

02374

01862

02348

02193

02161

02219

01929

(s4c1)

02799

02754

02786

01781

01565

01962

00813

01870

01445

01556

01554

01026

(s4c2)

02597

02547

02580

01278

00974

01551

-00235

01392

00699

00952

00889

00125

(s4c3)

02394

02339

02375

00776

00384

0114

0-012

8100915

-0004

700349

00226

-00774

(s4c4)

02192

02132

02169

00275

-00205

00729

-02326

00439

-00792

-00254

-00437

-016

73(s4c5)

01989

01926

01964

-00225

-00794

00319

-033

69-00037

-015

35-00856

-010

99-02570

Mathematical Problems in Engineering 21

the transaction cost structures (s0 c1) (s0 c2) (s0 c3) (s0c4) (s0 c5) if we do not consider transparent transactioncost ie c=0 the average ARR of RNN is 02531 under thetransaction cost structure (s1 c0) (s2 c0) (s3 c0) (s4c0) so transparent transaction cost has greater impact thanslippage Through multiple comparative analysis the ARRunder the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s0 c1) are not significantly different from the ARRwithout transaction cost for MLP DBN and SAE the ARRunder all other transaction cost structures are significantlysmaller than theARRwithout transaction cost For all tradingalgorithms except for MLP DBN and SAE the ARR underthe transaction cost structures (s1 c0) (s2 c0) are notsignificantly different from the ARR without transactioncost the ARR under all other transaction cost structures aresignificantly smaller than the ARR without transaction cost

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 26 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theASR of each algorithm is the lowest Compared with settingwithout transaction cost the ASR of MLP DBN and SAEreduce by 3997 4123 and 4066 respectively while theASR of other trading algorithms reduce by more than 90compared with the case of no transaction cost Thereforeexcessive transaction cost will significantly reduce ASR Fora general setting of s and c ie (s c) = (002 0003) theASR of MLP DBN and SAE decrease by 2262 2336and 2302 respectively while the ASR of other algorithmsdecrease by more than 50 the ASR of CART and XGBdecrease by more than 100Therefore MLP DBN and SAEare more tolerant to transaction cost From single tradingalgorithm such as NB if we do not consider slippage ies=0 the average ASR of NB is 08052 under the transactioncost structure (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5)if we do not consider transparent transaction cost ie c=0the average ASR of NB is 14182 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has greater impact than slippage Throughmultiple comparative analysis the ASR under the transactioncost structures (s1 c0) (s2 c0) (s3 c0) (s0 c1) are notsignificantly different from the ASR without transaction costfor MLP DBN and SAE the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the ASR under the transaction cost structures(s1 c0) (s2 c0) are not significantly different from the ASRwithout transaction cost the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 27 MDD increases with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the settings without transaction cost theMDD of MLP DBN and SAE increase by 932 1108 and

1032 respectively The MDD of other trading algorithmsincrease by more than 80 compared with those withoutconsidering transaction costTherefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 483 580 and 533respectively while the MDD of other algorithms increase bymore than 35 and theMDDofCART RF andXGB increasebymore than 100Therefore MLP DBN and SAE are moretolerant to transaction cost As awhole theDNNmodels havestronger capacity to accommodate transaction cost than thetraditional ML models From single trading algorithm suchas GRU if we do not consider slippage ie s=0 the averageMDD of GRU is 04459 under the transaction cost structures(s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do notconsider transparent transaction cost ie c=0 the averageMDD of GRU is 03559 under the transaction cost structures(s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparent transactioncost has greater impact than slippage Through multiplecomparative analysis the MDD under any the transactioncost structure is not significantly different from the MDDwithout transaction cost for MLP DBN and SAE For alltrading algorithms except for MLP DBN and SAE such asLR the MDD under the transaction cost structures (s0 c1)(s1 c0) (s2 c0) (s3 c0) are not significantly different fromthe MDD without transaction cost the MDD under all othertransaction cost structures are significantly greater than theMDD without transaction cost

Through the analysis of the Table 27 performance eval-uation indicators we find that trading performance afterconsidering transaction cost will be worse than that withoutconsidering transaction cost as is in actual trading situationIt is noteworthy that the performance changes of DNNalgorithms especially MLP DBN and SAE are very smallafter considering transaction cost This shows that the threealgorithms have good tolerance to changes of transactioncost Especially for the MDD of the three algorithms thereis no significant difference with that with no transactioncost So we can consider applying them in actual tradingMeanwhile we conclude that the transparent transactioncost has greater impact on the trading performances thanthe slippage for SPICS This is because the prices of SPICSare too high when the transparent transaction cost is setto a certain percentage of turnover In actual transactionsspecial attention needs to be paid to the fact that the trans-action performance under most transaction cost structuresis significantly lower than the trading performance withoutconsidering transaction cost It is worth noting that theperformance of traditional ML algorithm is not worse thanthat ofDNNalgorithmswithout considering transaction costwhile the performance of DNN algorithms is better than thatof traditional ML algorithms after considering transactioncost

63 Analysis of Impact of Transaction Cost on the TradingPerformance of CSICS Similar to Section 62 we will discussthe impact of transaction cost on trading performance ofCSICS in the followings In the Chinese A-share marketthe transparent transaction cost is usually set to a certain

22 Mathematical Problems in Engineering

Table26Th

eASR

ofSP

ICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

1546

815

412

15502

15764

15571

15828

13927

16237

16763

15818

16018

16298

(s0c1)

1456

214

478

14577

1300

012

317

13565

09346

13554

12650

12472

12456

11294

(s0c2)

13639

13527

13635

10191

09015

11262

04657

10822

08482

09074

08846

06236

(s0c3)

12702

12561

12679

07355

05690

08929

-00085

08061

04298

05652

05216

0118

2(s0c4)

11751

11581

11709

04511

02366

06580

-04823

05291

00139

02234

01596

-03812

(s0c5)

1079

10591

10728

01678

-00931

04227

-09500

02534

-039

59-01152

-019

87-08696

(s1c0)

15121

1505

715

149

1492

714

606

15119

1244

915

424

1558

214

825

14974

1488

6(s1c1)

14208

14116

14217

12146

11334

12841

07823

12722

1144

711459

11394

09859

(s1c2)

13279

13159

13270

09325

08020

10526

03105

09977

07267

08048

07772

04792

(s1c3)

12337

12188

12308

064

8204690

08185

-016

4607209

03082

04622

04139

-00257

(s1c4)

11382

11204

11333

03637

01368

05831

-06374

04438

-010

6801208

00524

-052

31(s1c5)

10417

10210

10348

00807

-019

2003478

-110

2501686

-05146

-02169

-0304

7-10083

(s2c0)

1477

1469

914

792

1408

113

632

1440

310

946

1460

114

390

1382

213

922

1346

2(s2c1)

13851

13752

13854

11285

10343

12111

06283

11883

10237

10439

10325

08416

(s2c2)

12916

12789

12901

08454

07021

09785

01547

09128

060

4907019

06696

03346

(s2c3)

11969

11812

11934

05607

03688

07437

-032

0506355

01868

03591

03063

-016

90(s2c4)

11010

10825

10955

02763

00372

05081

-07916

03586

-02268

00183

-00545

-06639

(s2c5)

1004

109827

09967

-0006

-02905

02729

-12533

00841

-06323

-031

79-04101

-114

54(s3c0)

14415

14337

14432

13227

12650

13679

09425

13770

13189

12810

12862

12030

(s3c1)

13490

13384

13488

10419

09348

11375

04733

11039

09023

09413

09252

06971

(s3c2)

12551

12416

12529

07580

060

19090

40-00013

08275

04832

05988

05618

01904

(s3c3)

11599

11435

11558

04731

02688

066

88-04757

05500

00658

02562

01988

-031

16(s3c4)

10636

10443

10575

01891

-00620

04331

-0944

202735

-0346

0-00836

-016

08-08034

(s3c5)

09664

09443

09584

-00924

-03883

01982

-14018

000

00-074

89-04183

-05146

-12808

(s4c0)

14058

13972

1406

812

368

11662

12950

07892

12933

11983

11793

11796

10591

(s4c1)

13127

13013

13119

09549

08350

10634

03180

10190

07807

08386

08177

05527

(s4c2)

12183

1204

12155

06705

05018

08293

-015

6807421

03617

04958

04542

004

68(s4c3)

11226

11055

11179

03857

01691

05938

-06295

046

47-00545

01537

00918

-04529

(s4c4)

1026

1006

10193

01021

-016

0703582

-10948

01888

-0464

2-018

49-02665

-09413

(s4c5)

09286

09057

09199

-017

83-04853

01238

-15478

-00836

-0864

2-05177

-06182

-14142

Mathematical Problems in Engineering 23

Table 27 The MDD of SPICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 03583 03584 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338(s0 c1) 03629 03638 03594 03779 03986 03636 04072 03712 03843 03963 03972 04203(s0 c2) 03677 03695 03647 04302 04707 03968 05168 04127 04842 04729 04787 05735(s0 c3) 03727 03756 03703 04990 05639 04376 06564 04709 06172 05682 05844 07335(s0 c4) 03781 03821 03764 05767 06612 04873 07804 05424 07377 06653 06913 08447(s0 c5) 03839 03890 03828 06529 0746 05444 08730 06162 08272 07501 07808 09118(s1 c0) 03596 03600 03560 03500 036130 03446 03574 03502 03414 03585 03569 03540(s1 c1) 03642 03655 03609 03907 04156 03717 04320 03814 04067 04154 04170 04541(s1 c2) 03691 03712 03662 04466 04936 04066 05534 04270 05172 04971 05049 06168(s1 c3) 03742 03774 03720 05183 05895 04495 06928 04885 06499 05937 06129 07662(s1 c4) 03796 03839 03781 05961 06842 05013 08105 05610 07631 06884 07161 08649(s1 c5) 03856 03909 03847 0671 07646 05595 08946 06342 08451 07691 0800 09235(s2 c0) 03609 03615 03573 03607 03756 03517 03770 03586 03586 03739 03727 03787(s2 c1) 03656 03671 03623 04047 04349 03805 04627 03929 04339 04365 04397 04929(s2 c2) 03705 03729 03678 04642 05176 04171 05916 04424 05504 05218 05327 06577(s2 c3) 03756 03792 03736 05377 06143 04624 07277 05067 06805 06183 06402 07939(s2 c4) 03812 03859 03799 06155 07056 05161 08380 05796 07856 07099 07388 08816(s2 c5) 03873 03930 03866 06887 07816 05751 09126 06517 08606 07864 08172 09331(s3 c0) 03622 03631 03588 03729 03912 03594 04004 03685 03795 03909 03909 04081(s3 c1) 03669 03687 03639 04200 04555 03901 04966 04062 04622 04587 04642 05334(s3 c2) 03719 03746 03694 04826 05423 04286 06295 04589 05833 05465 05607 06936(s3 c3) 03772 03811 03754 05572 06377 04762 07609 05248 07081 06420 06657 08175(s3 c4) 03829 03879 03818 06341 07254 05314 08620 05980 08054 07300 07593 08956(s3 c5) 03894 03954 03888 07056 07972 05909 09275 06689 08740 08022 08325 09412(s4 c0) 03635 03647 03602 03861 04082 03678 04274 03798 04015 04096 04114 04396(s4 c1) 03683 03704 03654 04362 04774 04005 05325 04211 04908 04814 04894 05730(s4 c2) 03734 03765 03712 05013 05664 04410 06667 04758 06142 05707 05875 07253(s4 c3) 03790 03833 03775 05765 06600 04905 07906 05429 07330 06644 06894 08375(s4 c4) 03851 03904 03841 06521 07439 05470 08824 06162 08230 07485 07782 09074(s4 c5) 03917 03981 03913 07218 08115 06067 09395 06857 08858 08165 08463 09480

percentage of turnover and it is the same as the assumptionin the experimental settings As in the US stock market thesmallest unit of price change is 001 (one tick) It is reasonableto set slippage to be 001-005 Of course it should be notedthat the prices fluctuation may be more intense when closingthan that in the middle of a trading day

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 28 the WR is decreasing with the increaseof transaction cost for any trading algorithm When thetransaction cost is set to (s c) = (004 0005) the WR of eachalgorithm is the smallest Comparedwith the settings withouttransaction cost the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR SVM and XGB are reduced by671 688 697 2269 1726 1548 2430 14912484 2112 2112 and 2919 respectively For a generalsetting of s and c ie (s c) = (002 0003) the WR ofMLP DBN and SAE decrease by 410 420 and 430respectively while the WR of other algorithms decrease bymore than 9 the WR of CART RF and XGB decrease by

more than 15 Therefore MLP DBN and SAE are moretolerant to transaction cost From single trading algorithmsuch as LSTM if we do not consider slippage ie s=0 theaverage WR of DBN is 05417 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage WR of LSTM is 05304 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the WR under the transactioncost structures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the WR without transaction cost for MLPDBN SAE and NB the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN SAE and NB the WR under the transaction coststructure (s0 c1) is not significantly different from the WRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

24 Mathematical Problems in Engineering

Table 28 The WR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803(s0 c1) 05523 05527 05525 05525 05608 05620 05009 05227 05612 05665 05571 05595(s0 c2) 05488 05492 05489 05389 05512 05535 04879 05149 05460 05542 05445 05411(s0 c3) 05453 05456 05452 05258 05414 05451 04747 05068 05313 05418 05320 05234(s0 c4) 05417 05419 05414 05127 05320 05368 04622 04991 05172 05297 05202 05067(s0 c5) 05383 05383 05379 05004 05230 05286 04504 04917 05036 05180 05088 04905(s1 c0) 05494 05499 05497 05444 05541 05558 04925 05170 05520 05584 05492 05488(s1 c1) 05456 05459 05456 05286 05424 05456 04775 05080 05342 05437 05345 05275(s1 c2) 05421 05423 05420 05161 05335 05377 04654 05007 05207 05320 05231 05110(s1 c3) 05386 05388 05383 05036 05246 05296 04530 04931 05065 05205 05116 04946(s1 c4) 05353 05354 05349 04915 05156 05218 04419 04861 04937 05095 05007 04795(s1 c5) 05323 05323 05317 04808 05076 05148 04315 04796 04817 04995 04905 04652(s2 c0) 05431 05434 05431 05219 05368 05403 04707 05036 05269 05374 05286 05189(s2 c1) 05395 05397 05393 05078 05266 05314 04573 04956 05115 05242 05154 05005(s2 c2) 05360 05361 05357 04960 05181 05237 04458 04886 04985 05134 05046 04853(s2 c3) 05331 05331 05326 04850 05100 05167 04352 04818 04864 05031 04945 04711(s2 c4) 05300 05300 05293 04743 05018 05093 04252 04752 04746 04931 04846 04572(s2 c5) 05273 05271 05266 04648 04946 05029 04159 04692 04639 04838 04755 04445(s3 c0) 05373 05374 05371 05019 05216 05265 04514 04917 05049 05186 05098 04932(s3 c1) 05341 05341 05336 04902 05128 05188 04399 04846 04917 05074 04990 04775(s3 c2) 05312 05312 05306 04798 05052 05122 04303 04782 04804 04977 04896 04644(s3 c3) 05281 05281 05275 04696 04976 05049 04206 04718 04689 04879 04799 04509(s3 c4) 05252 05251 05245 04598 04901 04984 04110 04657 04581 04785 04707 04378(s3 c5) 05226 05223 05218 04510 04833 04924 04023 04602 04481 04701 04621 04264(s4 c0) 05325 05325 05321 04860 05089 05150 04360 04816 04870 05030 04949 04723(s4 c1) 05294 05294 05289 04753 05010 05079 04258 04750 04752 04928 04849 04588(s4 c2) 05266 05265 05259 04653 04937 05013 04164 04690 04642 04838 04761 04458(s4 c3) 05238 05236 05230 04562 04864 04948 04073 04632 04541 04747 04672 04336(s4 c4) 05211 05208 05203 04475 04798 04891 03985 04577 04440 04662 04586 04218(s4 c5) 05186 05182 05176 04392 04733 04832 03901 04524 04348 04582 04509 04109

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 29 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the smallest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 5073 5175 and 5225 respectivelyWhile the ARR of other trading algorithms decrease bymore than 100 compared with those algorithms withouttransaction cost Therefore excessive transaction cost canlead to serious losses in the accounts For a general settingof s and c ie (s c) = (002 0003) ARR of MLP DBNand SAE decrease by 2741 2797 and 2825 respectivelywhile the ARR other algorithms decrease by more than 50and that of CART NB RF and XGB decrease by more than100 Therefore MLP DBN and SAE are more tolerant totransaction cost From single trading algorithm such as SAEif we do not consider slippage ie s=0 the average ARR ofSAE is 05040 under the transaction cost structure (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not consider

transparent transaction cost ie c=0 the averageARRof SAEis 04468 under the transaction cost structures (s1 c0) (s2c0) (s3 c0) (s4 c0) so transparent transaction cost hassmaller impact than slippage Through multiple comparativeanalysis the ARR under the transaction cost structures (s0c1) (s0 c2) (s0 c3) (s0 c1) (s1 c1) are not significantlydifferent from the ARR without transaction cost for MLPDBN and SAE the ARR under all other transaction coststructures are significantly smaller than the ARR withouttransaction cost For RNN LSTM GRU CART RF LR andSVM the ARR under the transaction cost structures (s0c1) (s0 c2) (s1 c0) are not significantly different fromthe ARR without transaction cost the ARR under all othertransaction cost structures are significantly smaller than theARR without transaction cost For NB and XGB the ARRunder the transaction cost structures (s0 c1) (s1 c0) arenot significantly different from the ARR without transactioncost the ARR under all other transaction cost structuresare significantly smaller than the ARR without transactioncost

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 20: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

20 Mathematical Problems in Engineering

Table25Th

eARR

ofSP

ICSford

ailytradingwith

different

transactioncost

Ther

esultthatthere

isno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

03332

03296

03325

02943

02920

02934

03317

02975

03133

02942

03067

03041

(s0c1)

03128

030

8703118

02439

02327

02521

02266

02496

02384

02336

02400

02137

(s0c2)

02924

02879

02912

01936

01735

02108

01216

02017

01636

01731

01734

01234

(s0c3)

02721

02672

02706

01433

0114

301697

00168

01539

00889

01126

01070

00333

(s0c4)

02519

02464

02500

00931

00553

01285

-00878

01062

00143

00522

004

06-00567

(s0c5)

02316

02257

02294

00430

-00037

00875

-019

2400586

-00602

-0008

-00257

-014

66(s1c0)

03249

03212

03242

027

7802729

02794

029

53028

18028

9802747

028

5502762

(s1c1)

03046

03004

03035

02274

02136

02381

01902

02339

02149

02141

02188

01859

(s1c2)

02842

02796

02829

01771

01544

01969

00853

01861

01401

01536

01523

00957

(s1c3)

02639

02588

02623

01269

00953

01557

-00195

01383

00654

00931

00858

000

56(s1c4)

02437

02381

02417

00767

00363

0114

6-012

41009

06-00091

00328

00195

-00844

(s1c5)

02234

02174

02211

00266

-00226

00735

-02285

00430

-00836

-00275

-0046

8-01742

(s2c0)

03167

03129

03159

026

1302538

026

54025

89026

61026

6302551

026

43024

84(s2c1)

02964

02921

02952

02110

01946

02241

01539

02182

01914

01946

01977

01581

(s2c2)

0276

02713

02746

01607

01354

01829

00490

01704

0116

701341

01312

006

79(s2c3)

02557

02505

02540

0110

400763

01418

-00557

01227

004

2000737

006

47-00221

(s2c4)

02355

02298

02334

006

0300173

01007

-016

0300750

-00325

00134

-00016

-01120

(s2c5)

02153

02091

02129

00102

-00416

00597

-0264

700274

-010

69-00469

-00678

-02018

(s3c0)

030

85030

46030

7602448

02348

02514

02225

02504

02428

02356

02431

02206

(s3c1)

02881

02838

02869

01945

01756

02102

0117

502026

01680

01751

01765

01304

(s3c2)

02678

02630

02663

01442

01164

01690

00127

01548

00933

0114

601100

004

02(s3c3)

02476

02422

02457

00940

00574

01279

-00919

01071

00187

00543

00436

-00498

(s3c4)

02273

02215

02252

00439

-00016

00868

-019

6400595

-00558

-0006

-00227

-013

97(s3c5)

02071

02008

02047

-00062

-0060

5004

58-0300

800119

-013

02-00662

-00889

-02294

(s4c0)

03003

02962

02993

02284

02157

02374

01862

02348

02193

02161

02219

01929

(s4c1)

02799

02754

02786

01781

01565

01962

00813

01870

01445

01556

01554

01026

(s4c2)

02597

02547

02580

01278

00974

01551

-00235

01392

00699

00952

00889

00125

(s4c3)

02394

02339

02375

00776

00384

0114

0-012

8100915

-0004

700349

00226

-00774

(s4c4)

02192

02132

02169

00275

-00205

00729

-02326

00439

-00792

-00254

-00437

-016

73(s4c5)

01989

01926

01964

-00225

-00794

00319

-033

69-00037

-015

35-00856

-010

99-02570

Mathematical Problems in Engineering 21

the transaction cost structures (s0 c1) (s0 c2) (s0 c3) (s0c4) (s0 c5) if we do not consider transparent transactioncost ie c=0 the average ARR of RNN is 02531 under thetransaction cost structure (s1 c0) (s2 c0) (s3 c0) (s4c0) so transparent transaction cost has greater impact thanslippage Through multiple comparative analysis the ARRunder the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s0 c1) are not significantly different from the ARRwithout transaction cost for MLP DBN and SAE the ARRunder all other transaction cost structures are significantlysmaller than theARRwithout transaction cost For all tradingalgorithms except for MLP DBN and SAE the ARR underthe transaction cost structures (s1 c0) (s2 c0) are notsignificantly different from the ARR without transactioncost the ARR under all other transaction cost structures aresignificantly smaller than the ARR without transaction cost

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 26 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theASR of each algorithm is the lowest Compared with settingwithout transaction cost the ASR of MLP DBN and SAEreduce by 3997 4123 and 4066 respectively while theASR of other trading algorithms reduce by more than 90compared with the case of no transaction cost Thereforeexcessive transaction cost will significantly reduce ASR Fora general setting of s and c ie (s c) = (002 0003) theASR of MLP DBN and SAE decrease by 2262 2336and 2302 respectively while the ASR of other algorithmsdecrease by more than 50 the ASR of CART and XGBdecrease by more than 100Therefore MLP DBN and SAEare more tolerant to transaction cost From single tradingalgorithm such as NB if we do not consider slippage ies=0 the average ASR of NB is 08052 under the transactioncost structure (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5)if we do not consider transparent transaction cost ie c=0the average ASR of NB is 14182 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has greater impact than slippage Throughmultiple comparative analysis the ASR under the transactioncost structures (s1 c0) (s2 c0) (s3 c0) (s0 c1) are notsignificantly different from the ASR without transaction costfor MLP DBN and SAE the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the ASR under the transaction cost structures(s1 c0) (s2 c0) are not significantly different from the ASRwithout transaction cost the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 27 MDD increases with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the settings without transaction cost theMDD of MLP DBN and SAE increase by 932 1108 and

1032 respectively The MDD of other trading algorithmsincrease by more than 80 compared with those withoutconsidering transaction costTherefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 483 580 and 533respectively while the MDD of other algorithms increase bymore than 35 and theMDDofCART RF andXGB increasebymore than 100Therefore MLP DBN and SAE are moretolerant to transaction cost As awhole theDNNmodels havestronger capacity to accommodate transaction cost than thetraditional ML models From single trading algorithm suchas GRU if we do not consider slippage ie s=0 the averageMDD of GRU is 04459 under the transaction cost structures(s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do notconsider transparent transaction cost ie c=0 the averageMDD of GRU is 03559 under the transaction cost structures(s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparent transactioncost has greater impact than slippage Through multiplecomparative analysis the MDD under any the transactioncost structure is not significantly different from the MDDwithout transaction cost for MLP DBN and SAE For alltrading algorithms except for MLP DBN and SAE such asLR the MDD under the transaction cost structures (s0 c1)(s1 c0) (s2 c0) (s3 c0) are not significantly different fromthe MDD without transaction cost the MDD under all othertransaction cost structures are significantly greater than theMDD without transaction cost

Through the analysis of the Table 27 performance eval-uation indicators we find that trading performance afterconsidering transaction cost will be worse than that withoutconsidering transaction cost as is in actual trading situationIt is noteworthy that the performance changes of DNNalgorithms especially MLP DBN and SAE are very smallafter considering transaction cost This shows that the threealgorithms have good tolerance to changes of transactioncost Especially for the MDD of the three algorithms thereis no significant difference with that with no transactioncost So we can consider applying them in actual tradingMeanwhile we conclude that the transparent transactioncost has greater impact on the trading performances thanthe slippage for SPICS This is because the prices of SPICSare too high when the transparent transaction cost is setto a certain percentage of turnover In actual transactionsspecial attention needs to be paid to the fact that the trans-action performance under most transaction cost structuresis significantly lower than the trading performance withoutconsidering transaction cost It is worth noting that theperformance of traditional ML algorithm is not worse thanthat ofDNNalgorithmswithout considering transaction costwhile the performance of DNN algorithms is better than thatof traditional ML algorithms after considering transactioncost

63 Analysis of Impact of Transaction Cost on the TradingPerformance of CSICS Similar to Section 62 we will discussthe impact of transaction cost on trading performance ofCSICS in the followings In the Chinese A-share marketthe transparent transaction cost is usually set to a certain

22 Mathematical Problems in Engineering

Table26Th

eASR

ofSP

ICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

1546

815

412

15502

15764

15571

15828

13927

16237

16763

15818

16018

16298

(s0c1)

1456

214

478

14577

1300

012

317

13565

09346

13554

12650

12472

12456

11294

(s0c2)

13639

13527

13635

10191

09015

11262

04657

10822

08482

09074

08846

06236

(s0c3)

12702

12561

12679

07355

05690

08929

-00085

08061

04298

05652

05216

0118

2(s0c4)

11751

11581

11709

04511

02366

06580

-04823

05291

00139

02234

01596

-03812

(s0c5)

1079

10591

10728

01678

-00931

04227

-09500

02534

-039

59-01152

-019

87-08696

(s1c0)

15121

1505

715

149

1492

714

606

15119

1244

915

424

1558

214

825

14974

1488

6(s1c1)

14208

14116

14217

12146

11334

12841

07823

12722

1144

711459

11394

09859

(s1c2)

13279

13159

13270

09325

08020

10526

03105

09977

07267

08048

07772

04792

(s1c3)

12337

12188

12308

064

8204690

08185

-016

4607209

03082

04622

04139

-00257

(s1c4)

11382

11204

11333

03637

01368

05831

-06374

04438

-010

6801208

00524

-052

31(s1c5)

10417

10210

10348

00807

-019

2003478

-110

2501686

-05146

-02169

-0304

7-10083

(s2c0)

1477

1469

914

792

1408

113

632

1440

310

946

1460

114

390

1382

213

922

1346

2(s2c1)

13851

13752

13854

11285

10343

12111

06283

11883

10237

10439

10325

08416

(s2c2)

12916

12789

12901

08454

07021

09785

01547

09128

060

4907019

06696

03346

(s2c3)

11969

11812

11934

05607

03688

07437

-032

0506355

01868

03591

03063

-016

90(s2c4)

11010

10825

10955

02763

00372

05081

-07916

03586

-02268

00183

-00545

-06639

(s2c5)

1004

109827

09967

-0006

-02905

02729

-12533

00841

-06323

-031

79-04101

-114

54(s3c0)

14415

14337

14432

13227

12650

13679

09425

13770

13189

12810

12862

12030

(s3c1)

13490

13384

13488

10419

09348

11375

04733

11039

09023

09413

09252

06971

(s3c2)

12551

12416

12529

07580

060

19090

40-00013

08275

04832

05988

05618

01904

(s3c3)

11599

11435

11558

04731

02688

066

88-04757

05500

00658

02562

01988

-031

16(s3c4)

10636

10443

10575

01891

-00620

04331

-0944

202735

-0346

0-00836

-016

08-08034

(s3c5)

09664

09443

09584

-00924

-03883

01982

-14018

000

00-074

89-04183

-05146

-12808

(s4c0)

14058

13972

1406

812

368

11662

12950

07892

12933

11983

11793

11796

10591

(s4c1)

13127

13013

13119

09549

08350

10634

03180

10190

07807

08386

08177

05527

(s4c2)

12183

1204

12155

06705

05018

08293

-015

6807421

03617

04958

04542

004

68(s4c3)

11226

11055

11179

03857

01691

05938

-06295

046

47-00545

01537

00918

-04529

(s4c4)

1026

1006

10193

01021

-016

0703582

-10948

01888

-0464

2-018

49-02665

-09413

(s4c5)

09286

09057

09199

-017

83-04853

01238

-15478

-00836

-0864

2-05177

-06182

-14142

Mathematical Problems in Engineering 23

Table 27 The MDD of SPICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 03583 03584 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338(s0 c1) 03629 03638 03594 03779 03986 03636 04072 03712 03843 03963 03972 04203(s0 c2) 03677 03695 03647 04302 04707 03968 05168 04127 04842 04729 04787 05735(s0 c3) 03727 03756 03703 04990 05639 04376 06564 04709 06172 05682 05844 07335(s0 c4) 03781 03821 03764 05767 06612 04873 07804 05424 07377 06653 06913 08447(s0 c5) 03839 03890 03828 06529 0746 05444 08730 06162 08272 07501 07808 09118(s1 c0) 03596 03600 03560 03500 036130 03446 03574 03502 03414 03585 03569 03540(s1 c1) 03642 03655 03609 03907 04156 03717 04320 03814 04067 04154 04170 04541(s1 c2) 03691 03712 03662 04466 04936 04066 05534 04270 05172 04971 05049 06168(s1 c3) 03742 03774 03720 05183 05895 04495 06928 04885 06499 05937 06129 07662(s1 c4) 03796 03839 03781 05961 06842 05013 08105 05610 07631 06884 07161 08649(s1 c5) 03856 03909 03847 0671 07646 05595 08946 06342 08451 07691 0800 09235(s2 c0) 03609 03615 03573 03607 03756 03517 03770 03586 03586 03739 03727 03787(s2 c1) 03656 03671 03623 04047 04349 03805 04627 03929 04339 04365 04397 04929(s2 c2) 03705 03729 03678 04642 05176 04171 05916 04424 05504 05218 05327 06577(s2 c3) 03756 03792 03736 05377 06143 04624 07277 05067 06805 06183 06402 07939(s2 c4) 03812 03859 03799 06155 07056 05161 08380 05796 07856 07099 07388 08816(s2 c5) 03873 03930 03866 06887 07816 05751 09126 06517 08606 07864 08172 09331(s3 c0) 03622 03631 03588 03729 03912 03594 04004 03685 03795 03909 03909 04081(s3 c1) 03669 03687 03639 04200 04555 03901 04966 04062 04622 04587 04642 05334(s3 c2) 03719 03746 03694 04826 05423 04286 06295 04589 05833 05465 05607 06936(s3 c3) 03772 03811 03754 05572 06377 04762 07609 05248 07081 06420 06657 08175(s3 c4) 03829 03879 03818 06341 07254 05314 08620 05980 08054 07300 07593 08956(s3 c5) 03894 03954 03888 07056 07972 05909 09275 06689 08740 08022 08325 09412(s4 c0) 03635 03647 03602 03861 04082 03678 04274 03798 04015 04096 04114 04396(s4 c1) 03683 03704 03654 04362 04774 04005 05325 04211 04908 04814 04894 05730(s4 c2) 03734 03765 03712 05013 05664 04410 06667 04758 06142 05707 05875 07253(s4 c3) 03790 03833 03775 05765 06600 04905 07906 05429 07330 06644 06894 08375(s4 c4) 03851 03904 03841 06521 07439 05470 08824 06162 08230 07485 07782 09074(s4 c5) 03917 03981 03913 07218 08115 06067 09395 06857 08858 08165 08463 09480

percentage of turnover and it is the same as the assumptionin the experimental settings As in the US stock market thesmallest unit of price change is 001 (one tick) It is reasonableto set slippage to be 001-005 Of course it should be notedthat the prices fluctuation may be more intense when closingthan that in the middle of a trading day

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 28 the WR is decreasing with the increaseof transaction cost for any trading algorithm When thetransaction cost is set to (s c) = (004 0005) the WR of eachalgorithm is the smallest Comparedwith the settings withouttransaction cost the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR SVM and XGB are reduced by671 688 697 2269 1726 1548 2430 14912484 2112 2112 and 2919 respectively For a generalsetting of s and c ie (s c) = (002 0003) the WR ofMLP DBN and SAE decrease by 410 420 and 430respectively while the WR of other algorithms decrease bymore than 9 the WR of CART RF and XGB decrease by

more than 15 Therefore MLP DBN and SAE are moretolerant to transaction cost From single trading algorithmsuch as LSTM if we do not consider slippage ie s=0 theaverage WR of DBN is 05417 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage WR of LSTM is 05304 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the WR under the transactioncost structures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the WR without transaction cost for MLPDBN SAE and NB the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN SAE and NB the WR under the transaction coststructure (s0 c1) is not significantly different from the WRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

24 Mathematical Problems in Engineering

Table 28 The WR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803(s0 c1) 05523 05527 05525 05525 05608 05620 05009 05227 05612 05665 05571 05595(s0 c2) 05488 05492 05489 05389 05512 05535 04879 05149 05460 05542 05445 05411(s0 c3) 05453 05456 05452 05258 05414 05451 04747 05068 05313 05418 05320 05234(s0 c4) 05417 05419 05414 05127 05320 05368 04622 04991 05172 05297 05202 05067(s0 c5) 05383 05383 05379 05004 05230 05286 04504 04917 05036 05180 05088 04905(s1 c0) 05494 05499 05497 05444 05541 05558 04925 05170 05520 05584 05492 05488(s1 c1) 05456 05459 05456 05286 05424 05456 04775 05080 05342 05437 05345 05275(s1 c2) 05421 05423 05420 05161 05335 05377 04654 05007 05207 05320 05231 05110(s1 c3) 05386 05388 05383 05036 05246 05296 04530 04931 05065 05205 05116 04946(s1 c4) 05353 05354 05349 04915 05156 05218 04419 04861 04937 05095 05007 04795(s1 c5) 05323 05323 05317 04808 05076 05148 04315 04796 04817 04995 04905 04652(s2 c0) 05431 05434 05431 05219 05368 05403 04707 05036 05269 05374 05286 05189(s2 c1) 05395 05397 05393 05078 05266 05314 04573 04956 05115 05242 05154 05005(s2 c2) 05360 05361 05357 04960 05181 05237 04458 04886 04985 05134 05046 04853(s2 c3) 05331 05331 05326 04850 05100 05167 04352 04818 04864 05031 04945 04711(s2 c4) 05300 05300 05293 04743 05018 05093 04252 04752 04746 04931 04846 04572(s2 c5) 05273 05271 05266 04648 04946 05029 04159 04692 04639 04838 04755 04445(s3 c0) 05373 05374 05371 05019 05216 05265 04514 04917 05049 05186 05098 04932(s3 c1) 05341 05341 05336 04902 05128 05188 04399 04846 04917 05074 04990 04775(s3 c2) 05312 05312 05306 04798 05052 05122 04303 04782 04804 04977 04896 04644(s3 c3) 05281 05281 05275 04696 04976 05049 04206 04718 04689 04879 04799 04509(s3 c4) 05252 05251 05245 04598 04901 04984 04110 04657 04581 04785 04707 04378(s3 c5) 05226 05223 05218 04510 04833 04924 04023 04602 04481 04701 04621 04264(s4 c0) 05325 05325 05321 04860 05089 05150 04360 04816 04870 05030 04949 04723(s4 c1) 05294 05294 05289 04753 05010 05079 04258 04750 04752 04928 04849 04588(s4 c2) 05266 05265 05259 04653 04937 05013 04164 04690 04642 04838 04761 04458(s4 c3) 05238 05236 05230 04562 04864 04948 04073 04632 04541 04747 04672 04336(s4 c4) 05211 05208 05203 04475 04798 04891 03985 04577 04440 04662 04586 04218(s4 c5) 05186 05182 05176 04392 04733 04832 03901 04524 04348 04582 04509 04109

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 29 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the smallest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 5073 5175 and 5225 respectivelyWhile the ARR of other trading algorithms decrease bymore than 100 compared with those algorithms withouttransaction cost Therefore excessive transaction cost canlead to serious losses in the accounts For a general settingof s and c ie (s c) = (002 0003) ARR of MLP DBNand SAE decrease by 2741 2797 and 2825 respectivelywhile the ARR other algorithms decrease by more than 50and that of CART NB RF and XGB decrease by more than100 Therefore MLP DBN and SAE are more tolerant totransaction cost From single trading algorithm such as SAEif we do not consider slippage ie s=0 the average ARR ofSAE is 05040 under the transaction cost structure (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not consider

transparent transaction cost ie c=0 the averageARRof SAEis 04468 under the transaction cost structures (s1 c0) (s2c0) (s3 c0) (s4 c0) so transparent transaction cost hassmaller impact than slippage Through multiple comparativeanalysis the ARR under the transaction cost structures (s0c1) (s0 c2) (s0 c3) (s0 c1) (s1 c1) are not significantlydifferent from the ARR without transaction cost for MLPDBN and SAE the ARR under all other transaction coststructures are significantly smaller than the ARR withouttransaction cost For RNN LSTM GRU CART RF LR andSVM the ARR under the transaction cost structures (s0c1) (s0 c2) (s1 c0) are not significantly different fromthe ARR without transaction cost the ARR under all othertransaction cost structures are significantly smaller than theARR without transaction cost For NB and XGB the ARRunder the transaction cost structures (s0 c1) (s1 c0) arenot significantly different from the ARR without transactioncost the ARR under all other transaction cost structuresare significantly smaller than the ARR without transactioncost

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 21: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

Mathematical Problems in Engineering 21

the transaction cost structures (s0 c1) (s0 c2) (s0 c3) (s0c4) (s0 c5) if we do not consider transparent transactioncost ie c=0 the average ARR of RNN is 02531 under thetransaction cost structure (s1 c0) (s2 c0) (s3 c0) (s4c0) so transparent transaction cost has greater impact thanslippage Through multiple comparative analysis the ARRunder the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s0 c1) are not significantly different from the ARRwithout transaction cost for MLP DBN and SAE the ARRunder all other transaction cost structures are significantlysmaller than theARRwithout transaction cost For all tradingalgorithms except for MLP DBN and SAE the ARR underthe transaction cost structures (s1 c0) (s2 c0) are notsignificantly different from the ARR without transactioncost the ARR under all other transaction cost structures aresignificantly smaller than the ARR without transaction cost

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 26 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theASR of each algorithm is the lowest Compared with settingwithout transaction cost the ASR of MLP DBN and SAEreduce by 3997 4123 and 4066 respectively while theASR of other trading algorithms reduce by more than 90compared with the case of no transaction cost Thereforeexcessive transaction cost will significantly reduce ASR Fora general setting of s and c ie (s c) = (002 0003) theASR of MLP DBN and SAE decrease by 2262 2336and 2302 respectively while the ASR of other algorithmsdecrease by more than 50 the ASR of CART and XGBdecrease by more than 100Therefore MLP DBN and SAEare more tolerant to transaction cost From single tradingalgorithm such as NB if we do not consider slippage ies=0 the average ASR of NB is 08052 under the transactioncost structure (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5)if we do not consider transparent transaction cost ie c=0the average ASR of NB is 14182 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has greater impact than slippage Throughmultiple comparative analysis the ASR under the transactioncost structures (s1 c0) (s2 c0) (s3 c0) (s0 c1) are notsignificantly different from the ASR without transaction costfor MLP DBN and SAE the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost For all trading algorithms except for MLPDBN and SAE the ASR under the transaction cost structures(s1 c0) (s2 c0) are not significantly different from the ASRwithout transaction cost the ASR under all other transactioncost structures are significantly smaller than the ASR withouttransaction cost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 27 MDD increases with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the settings without transaction cost theMDD of MLP DBN and SAE increase by 932 1108 and

1032 respectively The MDD of other trading algorithmsincrease by more than 80 compared with those withoutconsidering transaction costTherefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 483 580 and 533respectively while the MDD of other algorithms increase bymore than 35 and theMDDofCART RF andXGB increasebymore than 100Therefore MLP DBN and SAE are moretolerant to transaction cost As awhole theDNNmodels havestronger capacity to accommodate transaction cost than thetraditional ML models From single trading algorithm suchas GRU if we do not consider slippage ie s=0 the averageMDD of GRU is 04459 under the transaction cost structures(s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do notconsider transparent transaction cost ie c=0 the averageMDD of GRU is 03559 under the transaction cost structures(s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparent transactioncost has greater impact than slippage Through multiplecomparative analysis the MDD under any the transactioncost structure is not significantly different from the MDDwithout transaction cost for MLP DBN and SAE For alltrading algorithms except for MLP DBN and SAE such asLR the MDD under the transaction cost structures (s0 c1)(s1 c0) (s2 c0) (s3 c0) are not significantly different fromthe MDD without transaction cost the MDD under all othertransaction cost structures are significantly greater than theMDD without transaction cost

Through the analysis of the Table 27 performance eval-uation indicators we find that trading performance afterconsidering transaction cost will be worse than that withoutconsidering transaction cost as is in actual trading situationIt is noteworthy that the performance changes of DNNalgorithms especially MLP DBN and SAE are very smallafter considering transaction cost This shows that the threealgorithms have good tolerance to changes of transactioncost Especially for the MDD of the three algorithms thereis no significant difference with that with no transactioncost So we can consider applying them in actual tradingMeanwhile we conclude that the transparent transactioncost has greater impact on the trading performances thanthe slippage for SPICS This is because the prices of SPICSare too high when the transparent transaction cost is setto a certain percentage of turnover In actual transactionsspecial attention needs to be paid to the fact that the trans-action performance under most transaction cost structuresis significantly lower than the trading performance withoutconsidering transaction cost It is worth noting that theperformance of traditional ML algorithm is not worse thanthat ofDNNalgorithmswithout considering transaction costwhile the performance of DNN algorithms is better than thatof traditional ML algorithms after considering transactioncost

63 Analysis of Impact of Transaction Cost on the TradingPerformance of CSICS Similar to Section 62 we will discussthe impact of transaction cost on trading performance ofCSICS in the followings In the Chinese A-share marketthe transparent transaction cost is usually set to a certain

22 Mathematical Problems in Engineering

Table26Th

eASR

ofSP

ICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

1546

815

412

15502

15764

15571

15828

13927

16237

16763

15818

16018

16298

(s0c1)

1456

214

478

14577

1300

012

317

13565

09346

13554

12650

12472

12456

11294

(s0c2)

13639

13527

13635

10191

09015

11262

04657

10822

08482

09074

08846

06236

(s0c3)

12702

12561

12679

07355

05690

08929

-00085

08061

04298

05652

05216

0118

2(s0c4)

11751

11581

11709

04511

02366

06580

-04823

05291

00139

02234

01596

-03812

(s0c5)

1079

10591

10728

01678

-00931

04227

-09500

02534

-039

59-01152

-019

87-08696

(s1c0)

15121

1505

715

149

1492

714

606

15119

1244

915

424

1558

214

825

14974

1488

6(s1c1)

14208

14116

14217

12146

11334

12841

07823

12722

1144

711459

11394

09859

(s1c2)

13279

13159

13270

09325

08020

10526

03105

09977

07267

08048

07772

04792

(s1c3)

12337

12188

12308

064

8204690

08185

-016

4607209

03082

04622

04139

-00257

(s1c4)

11382

11204

11333

03637

01368

05831

-06374

04438

-010

6801208

00524

-052

31(s1c5)

10417

10210

10348

00807

-019

2003478

-110

2501686

-05146

-02169

-0304

7-10083

(s2c0)

1477

1469

914

792

1408

113

632

1440

310

946

1460

114

390

1382

213

922

1346

2(s2c1)

13851

13752

13854

11285

10343

12111

06283

11883

10237

10439

10325

08416

(s2c2)

12916

12789

12901

08454

07021

09785

01547

09128

060

4907019

06696

03346

(s2c3)

11969

11812

11934

05607

03688

07437

-032

0506355

01868

03591

03063

-016

90(s2c4)

11010

10825

10955

02763

00372

05081

-07916

03586

-02268

00183

-00545

-06639

(s2c5)

1004

109827

09967

-0006

-02905

02729

-12533

00841

-06323

-031

79-04101

-114

54(s3c0)

14415

14337

14432

13227

12650

13679

09425

13770

13189

12810

12862

12030

(s3c1)

13490

13384

13488

10419

09348

11375

04733

11039

09023

09413

09252

06971

(s3c2)

12551

12416

12529

07580

060

19090

40-00013

08275

04832

05988

05618

01904

(s3c3)

11599

11435

11558

04731

02688

066

88-04757

05500

00658

02562

01988

-031

16(s3c4)

10636

10443

10575

01891

-00620

04331

-0944

202735

-0346

0-00836

-016

08-08034

(s3c5)

09664

09443

09584

-00924

-03883

01982

-14018

000

00-074

89-04183

-05146

-12808

(s4c0)

14058

13972

1406

812

368

11662

12950

07892

12933

11983

11793

11796

10591

(s4c1)

13127

13013

13119

09549

08350

10634

03180

10190

07807

08386

08177

05527

(s4c2)

12183

1204

12155

06705

05018

08293

-015

6807421

03617

04958

04542

004

68(s4c3)

11226

11055

11179

03857

01691

05938

-06295

046

47-00545

01537

00918

-04529

(s4c4)

1026

1006

10193

01021

-016

0703582

-10948

01888

-0464

2-018

49-02665

-09413

(s4c5)

09286

09057

09199

-017

83-04853

01238

-15478

-00836

-0864

2-05177

-06182

-14142

Mathematical Problems in Engineering 23

Table 27 The MDD of SPICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 03583 03584 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338(s0 c1) 03629 03638 03594 03779 03986 03636 04072 03712 03843 03963 03972 04203(s0 c2) 03677 03695 03647 04302 04707 03968 05168 04127 04842 04729 04787 05735(s0 c3) 03727 03756 03703 04990 05639 04376 06564 04709 06172 05682 05844 07335(s0 c4) 03781 03821 03764 05767 06612 04873 07804 05424 07377 06653 06913 08447(s0 c5) 03839 03890 03828 06529 0746 05444 08730 06162 08272 07501 07808 09118(s1 c0) 03596 03600 03560 03500 036130 03446 03574 03502 03414 03585 03569 03540(s1 c1) 03642 03655 03609 03907 04156 03717 04320 03814 04067 04154 04170 04541(s1 c2) 03691 03712 03662 04466 04936 04066 05534 04270 05172 04971 05049 06168(s1 c3) 03742 03774 03720 05183 05895 04495 06928 04885 06499 05937 06129 07662(s1 c4) 03796 03839 03781 05961 06842 05013 08105 05610 07631 06884 07161 08649(s1 c5) 03856 03909 03847 0671 07646 05595 08946 06342 08451 07691 0800 09235(s2 c0) 03609 03615 03573 03607 03756 03517 03770 03586 03586 03739 03727 03787(s2 c1) 03656 03671 03623 04047 04349 03805 04627 03929 04339 04365 04397 04929(s2 c2) 03705 03729 03678 04642 05176 04171 05916 04424 05504 05218 05327 06577(s2 c3) 03756 03792 03736 05377 06143 04624 07277 05067 06805 06183 06402 07939(s2 c4) 03812 03859 03799 06155 07056 05161 08380 05796 07856 07099 07388 08816(s2 c5) 03873 03930 03866 06887 07816 05751 09126 06517 08606 07864 08172 09331(s3 c0) 03622 03631 03588 03729 03912 03594 04004 03685 03795 03909 03909 04081(s3 c1) 03669 03687 03639 04200 04555 03901 04966 04062 04622 04587 04642 05334(s3 c2) 03719 03746 03694 04826 05423 04286 06295 04589 05833 05465 05607 06936(s3 c3) 03772 03811 03754 05572 06377 04762 07609 05248 07081 06420 06657 08175(s3 c4) 03829 03879 03818 06341 07254 05314 08620 05980 08054 07300 07593 08956(s3 c5) 03894 03954 03888 07056 07972 05909 09275 06689 08740 08022 08325 09412(s4 c0) 03635 03647 03602 03861 04082 03678 04274 03798 04015 04096 04114 04396(s4 c1) 03683 03704 03654 04362 04774 04005 05325 04211 04908 04814 04894 05730(s4 c2) 03734 03765 03712 05013 05664 04410 06667 04758 06142 05707 05875 07253(s4 c3) 03790 03833 03775 05765 06600 04905 07906 05429 07330 06644 06894 08375(s4 c4) 03851 03904 03841 06521 07439 05470 08824 06162 08230 07485 07782 09074(s4 c5) 03917 03981 03913 07218 08115 06067 09395 06857 08858 08165 08463 09480

percentage of turnover and it is the same as the assumptionin the experimental settings As in the US stock market thesmallest unit of price change is 001 (one tick) It is reasonableto set slippage to be 001-005 Of course it should be notedthat the prices fluctuation may be more intense when closingthan that in the middle of a trading day

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 28 the WR is decreasing with the increaseof transaction cost for any trading algorithm When thetransaction cost is set to (s c) = (004 0005) the WR of eachalgorithm is the smallest Comparedwith the settings withouttransaction cost the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR SVM and XGB are reduced by671 688 697 2269 1726 1548 2430 14912484 2112 2112 and 2919 respectively For a generalsetting of s and c ie (s c) = (002 0003) the WR ofMLP DBN and SAE decrease by 410 420 and 430respectively while the WR of other algorithms decrease bymore than 9 the WR of CART RF and XGB decrease by

more than 15 Therefore MLP DBN and SAE are moretolerant to transaction cost From single trading algorithmsuch as LSTM if we do not consider slippage ie s=0 theaverage WR of DBN is 05417 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage WR of LSTM is 05304 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the WR under the transactioncost structures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the WR without transaction cost for MLPDBN SAE and NB the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN SAE and NB the WR under the transaction coststructure (s0 c1) is not significantly different from the WRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

24 Mathematical Problems in Engineering

Table 28 The WR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803(s0 c1) 05523 05527 05525 05525 05608 05620 05009 05227 05612 05665 05571 05595(s0 c2) 05488 05492 05489 05389 05512 05535 04879 05149 05460 05542 05445 05411(s0 c3) 05453 05456 05452 05258 05414 05451 04747 05068 05313 05418 05320 05234(s0 c4) 05417 05419 05414 05127 05320 05368 04622 04991 05172 05297 05202 05067(s0 c5) 05383 05383 05379 05004 05230 05286 04504 04917 05036 05180 05088 04905(s1 c0) 05494 05499 05497 05444 05541 05558 04925 05170 05520 05584 05492 05488(s1 c1) 05456 05459 05456 05286 05424 05456 04775 05080 05342 05437 05345 05275(s1 c2) 05421 05423 05420 05161 05335 05377 04654 05007 05207 05320 05231 05110(s1 c3) 05386 05388 05383 05036 05246 05296 04530 04931 05065 05205 05116 04946(s1 c4) 05353 05354 05349 04915 05156 05218 04419 04861 04937 05095 05007 04795(s1 c5) 05323 05323 05317 04808 05076 05148 04315 04796 04817 04995 04905 04652(s2 c0) 05431 05434 05431 05219 05368 05403 04707 05036 05269 05374 05286 05189(s2 c1) 05395 05397 05393 05078 05266 05314 04573 04956 05115 05242 05154 05005(s2 c2) 05360 05361 05357 04960 05181 05237 04458 04886 04985 05134 05046 04853(s2 c3) 05331 05331 05326 04850 05100 05167 04352 04818 04864 05031 04945 04711(s2 c4) 05300 05300 05293 04743 05018 05093 04252 04752 04746 04931 04846 04572(s2 c5) 05273 05271 05266 04648 04946 05029 04159 04692 04639 04838 04755 04445(s3 c0) 05373 05374 05371 05019 05216 05265 04514 04917 05049 05186 05098 04932(s3 c1) 05341 05341 05336 04902 05128 05188 04399 04846 04917 05074 04990 04775(s3 c2) 05312 05312 05306 04798 05052 05122 04303 04782 04804 04977 04896 04644(s3 c3) 05281 05281 05275 04696 04976 05049 04206 04718 04689 04879 04799 04509(s3 c4) 05252 05251 05245 04598 04901 04984 04110 04657 04581 04785 04707 04378(s3 c5) 05226 05223 05218 04510 04833 04924 04023 04602 04481 04701 04621 04264(s4 c0) 05325 05325 05321 04860 05089 05150 04360 04816 04870 05030 04949 04723(s4 c1) 05294 05294 05289 04753 05010 05079 04258 04750 04752 04928 04849 04588(s4 c2) 05266 05265 05259 04653 04937 05013 04164 04690 04642 04838 04761 04458(s4 c3) 05238 05236 05230 04562 04864 04948 04073 04632 04541 04747 04672 04336(s4 c4) 05211 05208 05203 04475 04798 04891 03985 04577 04440 04662 04586 04218(s4 c5) 05186 05182 05176 04392 04733 04832 03901 04524 04348 04582 04509 04109

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 29 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the smallest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 5073 5175 and 5225 respectivelyWhile the ARR of other trading algorithms decrease bymore than 100 compared with those algorithms withouttransaction cost Therefore excessive transaction cost canlead to serious losses in the accounts For a general settingof s and c ie (s c) = (002 0003) ARR of MLP DBNand SAE decrease by 2741 2797 and 2825 respectivelywhile the ARR other algorithms decrease by more than 50and that of CART NB RF and XGB decrease by more than100 Therefore MLP DBN and SAE are more tolerant totransaction cost From single trading algorithm such as SAEif we do not consider slippage ie s=0 the average ARR ofSAE is 05040 under the transaction cost structure (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not consider

transparent transaction cost ie c=0 the averageARRof SAEis 04468 under the transaction cost structures (s1 c0) (s2c0) (s3 c0) (s4 c0) so transparent transaction cost hassmaller impact than slippage Through multiple comparativeanalysis the ARR under the transaction cost structures (s0c1) (s0 c2) (s0 c3) (s0 c1) (s1 c1) are not significantlydifferent from the ARR without transaction cost for MLPDBN and SAE the ARR under all other transaction coststructures are significantly smaller than the ARR withouttransaction cost For RNN LSTM GRU CART RF LR andSVM the ARR under the transaction cost structures (s0c1) (s0 c2) (s1 c0) are not significantly different fromthe ARR without transaction cost the ARR under all othertransaction cost structures are significantly smaller than theARR without transaction cost For NB and XGB the ARRunder the transaction cost structures (s0 c1) (s1 c0) arenot significantly different from the ARR without transactioncost the ARR under all other transaction cost structuresare significantly smaller than the ARR without transactioncost

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 22: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

22 Mathematical Problems in Engineering

Table26Th

eASR

ofSP

ICSford

ailytradingwith

different

transactioncost

Theresultthatthereisno

significantd

ifference

betweenperfo

rmance

with

outtransactio

ncostandthatwith

transactioncostisin

boldface

MLP

DBN

SAE

RNN

LSTM

GRU

CART

NB

RFLR

SVM

XGB

(s0c0)

1546

815

412

15502

15764

15571

15828

13927

16237

16763

15818

16018

16298

(s0c1)

1456

214

478

14577

1300

012

317

13565

09346

13554

12650

12472

12456

11294

(s0c2)

13639

13527

13635

10191

09015

11262

04657

10822

08482

09074

08846

06236

(s0c3)

12702

12561

12679

07355

05690

08929

-00085

08061

04298

05652

05216

0118

2(s0c4)

11751

11581

11709

04511

02366

06580

-04823

05291

00139

02234

01596

-03812

(s0c5)

1079

10591

10728

01678

-00931

04227

-09500

02534

-039

59-01152

-019

87-08696

(s1c0)

15121

1505

715

149

1492

714

606

15119

1244

915

424

1558

214

825

14974

1488

6(s1c1)

14208

14116

14217

12146

11334

12841

07823

12722

1144

711459

11394

09859

(s1c2)

13279

13159

13270

09325

08020

10526

03105

09977

07267

08048

07772

04792

(s1c3)

12337

12188

12308

064

8204690

08185

-016

4607209

03082

04622

04139

-00257

(s1c4)

11382

11204

11333

03637

01368

05831

-06374

04438

-010

6801208

00524

-052

31(s1c5)

10417

10210

10348

00807

-019

2003478

-110

2501686

-05146

-02169

-0304

7-10083

(s2c0)

1477

1469

914

792

1408

113

632

1440

310

946

1460

114

390

1382

213

922

1346

2(s2c1)

13851

13752

13854

11285

10343

12111

06283

11883

10237

10439

10325

08416

(s2c2)

12916

12789

12901

08454

07021

09785

01547

09128

060

4907019

06696

03346

(s2c3)

11969

11812

11934

05607

03688

07437

-032

0506355

01868

03591

03063

-016

90(s2c4)

11010

10825

10955

02763

00372

05081

-07916

03586

-02268

00183

-00545

-06639

(s2c5)

1004

109827

09967

-0006

-02905

02729

-12533

00841

-06323

-031

79-04101

-114

54(s3c0)

14415

14337

14432

13227

12650

13679

09425

13770

13189

12810

12862

12030

(s3c1)

13490

13384

13488

10419

09348

11375

04733

11039

09023

09413

09252

06971

(s3c2)

12551

12416

12529

07580

060

19090

40-00013

08275

04832

05988

05618

01904

(s3c3)

11599

11435

11558

04731

02688

066

88-04757

05500

00658

02562

01988

-031

16(s3c4)

10636

10443

10575

01891

-00620

04331

-0944

202735

-0346

0-00836

-016

08-08034

(s3c5)

09664

09443

09584

-00924

-03883

01982

-14018

000

00-074

89-04183

-05146

-12808

(s4c0)

14058

13972

1406

812

368

11662

12950

07892

12933

11983

11793

11796

10591

(s4c1)

13127

13013

13119

09549

08350

10634

03180

10190

07807

08386

08177

05527

(s4c2)

12183

1204

12155

06705

05018

08293

-015

6807421

03617

04958

04542

004

68(s4c3)

11226

11055

11179

03857

01691

05938

-06295

046

47-00545

01537

00918

-04529

(s4c4)

1026

1006

10193

01021

-016

0703582

-10948

01888

-0464

2-018

49-02665

-09413

(s4c5)

09286

09057

09199

-017

83-04853

01238

-15478

-00836

-0864

2-05177

-06182

-14142

Mathematical Problems in Engineering 23

Table 27 The MDD of SPICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 03583 03584 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338(s0 c1) 03629 03638 03594 03779 03986 03636 04072 03712 03843 03963 03972 04203(s0 c2) 03677 03695 03647 04302 04707 03968 05168 04127 04842 04729 04787 05735(s0 c3) 03727 03756 03703 04990 05639 04376 06564 04709 06172 05682 05844 07335(s0 c4) 03781 03821 03764 05767 06612 04873 07804 05424 07377 06653 06913 08447(s0 c5) 03839 03890 03828 06529 0746 05444 08730 06162 08272 07501 07808 09118(s1 c0) 03596 03600 03560 03500 036130 03446 03574 03502 03414 03585 03569 03540(s1 c1) 03642 03655 03609 03907 04156 03717 04320 03814 04067 04154 04170 04541(s1 c2) 03691 03712 03662 04466 04936 04066 05534 04270 05172 04971 05049 06168(s1 c3) 03742 03774 03720 05183 05895 04495 06928 04885 06499 05937 06129 07662(s1 c4) 03796 03839 03781 05961 06842 05013 08105 05610 07631 06884 07161 08649(s1 c5) 03856 03909 03847 0671 07646 05595 08946 06342 08451 07691 0800 09235(s2 c0) 03609 03615 03573 03607 03756 03517 03770 03586 03586 03739 03727 03787(s2 c1) 03656 03671 03623 04047 04349 03805 04627 03929 04339 04365 04397 04929(s2 c2) 03705 03729 03678 04642 05176 04171 05916 04424 05504 05218 05327 06577(s2 c3) 03756 03792 03736 05377 06143 04624 07277 05067 06805 06183 06402 07939(s2 c4) 03812 03859 03799 06155 07056 05161 08380 05796 07856 07099 07388 08816(s2 c5) 03873 03930 03866 06887 07816 05751 09126 06517 08606 07864 08172 09331(s3 c0) 03622 03631 03588 03729 03912 03594 04004 03685 03795 03909 03909 04081(s3 c1) 03669 03687 03639 04200 04555 03901 04966 04062 04622 04587 04642 05334(s3 c2) 03719 03746 03694 04826 05423 04286 06295 04589 05833 05465 05607 06936(s3 c3) 03772 03811 03754 05572 06377 04762 07609 05248 07081 06420 06657 08175(s3 c4) 03829 03879 03818 06341 07254 05314 08620 05980 08054 07300 07593 08956(s3 c5) 03894 03954 03888 07056 07972 05909 09275 06689 08740 08022 08325 09412(s4 c0) 03635 03647 03602 03861 04082 03678 04274 03798 04015 04096 04114 04396(s4 c1) 03683 03704 03654 04362 04774 04005 05325 04211 04908 04814 04894 05730(s4 c2) 03734 03765 03712 05013 05664 04410 06667 04758 06142 05707 05875 07253(s4 c3) 03790 03833 03775 05765 06600 04905 07906 05429 07330 06644 06894 08375(s4 c4) 03851 03904 03841 06521 07439 05470 08824 06162 08230 07485 07782 09074(s4 c5) 03917 03981 03913 07218 08115 06067 09395 06857 08858 08165 08463 09480

percentage of turnover and it is the same as the assumptionin the experimental settings As in the US stock market thesmallest unit of price change is 001 (one tick) It is reasonableto set slippage to be 001-005 Of course it should be notedthat the prices fluctuation may be more intense when closingthan that in the middle of a trading day

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 28 the WR is decreasing with the increaseof transaction cost for any trading algorithm When thetransaction cost is set to (s c) = (004 0005) the WR of eachalgorithm is the smallest Comparedwith the settings withouttransaction cost the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR SVM and XGB are reduced by671 688 697 2269 1726 1548 2430 14912484 2112 2112 and 2919 respectively For a generalsetting of s and c ie (s c) = (002 0003) the WR ofMLP DBN and SAE decrease by 410 420 and 430respectively while the WR of other algorithms decrease bymore than 9 the WR of CART RF and XGB decrease by

more than 15 Therefore MLP DBN and SAE are moretolerant to transaction cost From single trading algorithmsuch as LSTM if we do not consider slippage ie s=0 theaverage WR of DBN is 05417 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage WR of LSTM is 05304 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the WR under the transactioncost structures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the WR without transaction cost for MLPDBN SAE and NB the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN SAE and NB the WR under the transaction coststructure (s0 c1) is not significantly different from the WRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

24 Mathematical Problems in Engineering

Table 28 The WR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803(s0 c1) 05523 05527 05525 05525 05608 05620 05009 05227 05612 05665 05571 05595(s0 c2) 05488 05492 05489 05389 05512 05535 04879 05149 05460 05542 05445 05411(s0 c3) 05453 05456 05452 05258 05414 05451 04747 05068 05313 05418 05320 05234(s0 c4) 05417 05419 05414 05127 05320 05368 04622 04991 05172 05297 05202 05067(s0 c5) 05383 05383 05379 05004 05230 05286 04504 04917 05036 05180 05088 04905(s1 c0) 05494 05499 05497 05444 05541 05558 04925 05170 05520 05584 05492 05488(s1 c1) 05456 05459 05456 05286 05424 05456 04775 05080 05342 05437 05345 05275(s1 c2) 05421 05423 05420 05161 05335 05377 04654 05007 05207 05320 05231 05110(s1 c3) 05386 05388 05383 05036 05246 05296 04530 04931 05065 05205 05116 04946(s1 c4) 05353 05354 05349 04915 05156 05218 04419 04861 04937 05095 05007 04795(s1 c5) 05323 05323 05317 04808 05076 05148 04315 04796 04817 04995 04905 04652(s2 c0) 05431 05434 05431 05219 05368 05403 04707 05036 05269 05374 05286 05189(s2 c1) 05395 05397 05393 05078 05266 05314 04573 04956 05115 05242 05154 05005(s2 c2) 05360 05361 05357 04960 05181 05237 04458 04886 04985 05134 05046 04853(s2 c3) 05331 05331 05326 04850 05100 05167 04352 04818 04864 05031 04945 04711(s2 c4) 05300 05300 05293 04743 05018 05093 04252 04752 04746 04931 04846 04572(s2 c5) 05273 05271 05266 04648 04946 05029 04159 04692 04639 04838 04755 04445(s3 c0) 05373 05374 05371 05019 05216 05265 04514 04917 05049 05186 05098 04932(s3 c1) 05341 05341 05336 04902 05128 05188 04399 04846 04917 05074 04990 04775(s3 c2) 05312 05312 05306 04798 05052 05122 04303 04782 04804 04977 04896 04644(s3 c3) 05281 05281 05275 04696 04976 05049 04206 04718 04689 04879 04799 04509(s3 c4) 05252 05251 05245 04598 04901 04984 04110 04657 04581 04785 04707 04378(s3 c5) 05226 05223 05218 04510 04833 04924 04023 04602 04481 04701 04621 04264(s4 c0) 05325 05325 05321 04860 05089 05150 04360 04816 04870 05030 04949 04723(s4 c1) 05294 05294 05289 04753 05010 05079 04258 04750 04752 04928 04849 04588(s4 c2) 05266 05265 05259 04653 04937 05013 04164 04690 04642 04838 04761 04458(s4 c3) 05238 05236 05230 04562 04864 04948 04073 04632 04541 04747 04672 04336(s4 c4) 05211 05208 05203 04475 04798 04891 03985 04577 04440 04662 04586 04218(s4 c5) 05186 05182 05176 04392 04733 04832 03901 04524 04348 04582 04509 04109

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 29 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the smallest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 5073 5175 and 5225 respectivelyWhile the ARR of other trading algorithms decrease bymore than 100 compared with those algorithms withouttransaction cost Therefore excessive transaction cost canlead to serious losses in the accounts For a general settingof s and c ie (s c) = (002 0003) ARR of MLP DBNand SAE decrease by 2741 2797 and 2825 respectivelywhile the ARR other algorithms decrease by more than 50and that of CART NB RF and XGB decrease by more than100 Therefore MLP DBN and SAE are more tolerant totransaction cost From single trading algorithm such as SAEif we do not consider slippage ie s=0 the average ARR ofSAE is 05040 under the transaction cost structure (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not consider

transparent transaction cost ie c=0 the averageARRof SAEis 04468 under the transaction cost structures (s1 c0) (s2c0) (s3 c0) (s4 c0) so transparent transaction cost hassmaller impact than slippage Through multiple comparativeanalysis the ARR under the transaction cost structures (s0c1) (s0 c2) (s0 c3) (s0 c1) (s1 c1) are not significantlydifferent from the ARR without transaction cost for MLPDBN and SAE the ARR under all other transaction coststructures are significantly smaller than the ARR withouttransaction cost For RNN LSTM GRU CART RF LR andSVM the ARR under the transaction cost structures (s0c1) (s0 c2) (s1 c0) are not significantly different fromthe ARR without transaction cost the ARR under all othertransaction cost structures are significantly smaller than theARR without transaction cost For NB and XGB the ARRunder the transaction cost structures (s0 c1) (s1 c0) arenot significantly different from the ARR without transactioncost the ARR under all other transaction cost structuresare significantly smaller than the ARR without transactioncost

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 23: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

Mathematical Problems in Engineering 23

Table 27 The MDD of SPICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 03583 03584 03547 03403 03489 03381 03413 03428 03284 03447 03429 03338(s0 c1) 03629 03638 03594 03779 03986 03636 04072 03712 03843 03963 03972 04203(s0 c2) 03677 03695 03647 04302 04707 03968 05168 04127 04842 04729 04787 05735(s0 c3) 03727 03756 03703 04990 05639 04376 06564 04709 06172 05682 05844 07335(s0 c4) 03781 03821 03764 05767 06612 04873 07804 05424 07377 06653 06913 08447(s0 c5) 03839 03890 03828 06529 0746 05444 08730 06162 08272 07501 07808 09118(s1 c0) 03596 03600 03560 03500 036130 03446 03574 03502 03414 03585 03569 03540(s1 c1) 03642 03655 03609 03907 04156 03717 04320 03814 04067 04154 04170 04541(s1 c2) 03691 03712 03662 04466 04936 04066 05534 04270 05172 04971 05049 06168(s1 c3) 03742 03774 03720 05183 05895 04495 06928 04885 06499 05937 06129 07662(s1 c4) 03796 03839 03781 05961 06842 05013 08105 05610 07631 06884 07161 08649(s1 c5) 03856 03909 03847 0671 07646 05595 08946 06342 08451 07691 0800 09235(s2 c0) 03609 03615 03573 03607 03756 03517 03770 03586 03586 03739 03727 03787(s2 c1) 03656 03671 03623 04047 04349 03805 04627 03929 04339 04365 04397 04929(s2 c2) 03705 03729 03678 04642 05176 04171 05916 04424 05504 05218 05327 06577(s2 c3) 03756 03792 03736 05377 06143 04624 07277 05067 06805 06183 06402 07939(s2 c4) 03812 03859 03799 06155 07056 05161 08380 05796 07856 07099 07388 08816(s2 c5) 03873 03930 03866 06887 07816 05751 09126 06517 08606 07864 08172 09331(s3 c0) 03622 03631 03588 03729 03912 03594 04004 03685 03795 03909 03909 04081(s3 c1) 03669 03687 03639 04200 04555 03901 04966 04062 04622 04587 04642 05334(s3 c2) 03719 03746 03694 04826 05423 04286 06295 04589 05833 05465 05607 06936(s3 c3) 03772 03811 03754 05572 06377 04762 07609 05248 07081 06420 06657 08175(s3 c4) 03829 03879 03818 06341 07254 05314 08620 05980 08054 07300 07593 08956(s3 c5) 03894 03954 03888 07056 07972 05909 09275 06689 08740 08022 08325 09412(s4 c0) 03635 03647 03602 03861 04082 03678 04274 03798 04015 04096 04114 04396(s4 c1) 03683 03704 03654 04362 04774 04005 05325 04211 04908 04814 04894 05730(s4 c2) 03734 03765 03712 05013 05664 04410 06667 04758 06142 05707 05875 07253(s4 c3) 03790 03833 03775 05765 06600 04905 07906 05429 07330 06644 06894 08375(s4 c4) 03851 03904 03841 06521 07439 05470 08824 06162 08230 07485 07782 09074(s4 c5) 03917 03981 03913 07218 08115 06067 09395 06857 08858 08165 08463 09480

percentage of turnover and it is the same as the assumptionin the experimental settings As in the US stock market thesmallest unit of price change is 001 (one tick) It is reasonableto set slippage to be 001-005 Of course it should be notedthat the prices fluctuation may be more intense when closingthan that in the middle of a trading day

(1) Analysis of Impact of Transaction Cost on WR As can beseen from Table 28 the WR is decreasing with the increaseof transaction cost for any trading algorithm When thetransaction cost is set to (s c) = (004 0005) the WR of eachalgorithm is the smallest Comparedwith the settings withouttransaction cost the WR of MLP DBN SAE RNN LSTMGRU CART NB RF LR SVM and XGB are reduced by671 688 697 2269 1726 1548 2430 14912484 2112 2112 and 2919 respectively For a generalsetting of s and c ie (s c) = (002 0003) the WR ofMLP DBN and SAE decrease by 410 420 and 430respectively while the WR of other algorithms decrease bymore than 9 the WR of CART RF and XGB decrease by

more than 15 Therefore MLP DBN and SAE are moretolerant to transaction cost From single trading algorithmsuch as LSTM if we do not consider slippage ie s=0 theaverage WR of DBN is 05417 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage WR of LSTM is 05304 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the WR under the transactioncost structures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the WR without transaction cost for MLPDBN SAE and NB the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost For all trading algorithms except for MLPDBN SAE and NB the WR under the transaction coststructure (s0 c1) is not significantly different from the WRwithout transaction cost the WR under all other transactioncost structures are significantly smaller than the WR withouttransaction cost

24 Mathematical Problems in Engineering

Table 28 The WR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803(s0 c1) 05523 05527 05525 05525 05608 05620 05009 05227 05612 05665 05571 05595(s0 c2) 05488 05492 05489 05389 05512 05535 04879 05149 05460 05542 05445 05411(s0 c3) 05453 05456 05452 05258 05414 05451 04747 05068 05313 05418 05320 05234(s0 c4) 05417 05419 05414 05127 05320 05368 04622 04991 05172 05297 05202 05067(s0 c5) 05383 05383 05379 05004 05230 05286 04504 04917 05036 05180 05088 04905(s1 c0) 05494 05499 05497 05444 05541 05558 04925 05170 05520 05584 05492 05488(s1 c1) 05456 05459 05456 05286 05424 05456 04775 05080 05342 05437 05345 05275(s1 c2) 05421 05423 05420 05161 05335 05377 04654 05007 05207 05320 05231 05110(s1 c3) 05386 05388 05383 05036 05246 05296 04530 04931 05065 05205 05116 04946(s1 c4) 05353 05354 05349 04915 05156 05218 04419 04861 04937 05095 05007 04795(s1 c5) 05323 05323 05317 04808 05076 05148 04315 04796 04817 04995 04905 04652(s2 c0) 05431 05434 05431 05219 05368 05403 04707 05036 05269 05374 05286 05189(s2 c1) 05395 05397 05393 05078 05266 05314 04573 04956 05115 05242 05154 05005(s2 c2) 05360 05361 05357 04960 05181 05237 04458 04886 04985 05134 05046 04853(s2 c3) 05331 05331 05326 04850 05100 05167 04352 04818 04864 05031 04945 04711(s2 c4) 05300 05300 05293 04743 05018 05093 04252 04752 04746 04931 04846 04572(s2 c5) 05273 05271 05266 04648 04946 05029 04159 04692 04639 04838 04755 04445(s3 c0) 05373 05374 05371 05019 05216 05265 04514 04917 05049 05186 05098 04932(s3 c1) 05341 05341 05336 04902 05128 05188 04399 04846 04917 05074 04990 04775(s3 c2) 05312 05312 05306 04798 05052 05122 04303 04782 04804 04977 04896 04644(s3 c3) 05281 05281 05275 04696 04976 05049 04206 04718 04689 04879 04799 04509(s3 c4) 05252 05251 05245 04598 04901 04984 04110 04657 04581 04785 04707 04378(s3 c5) 05226 05223 05218 04510 04833 04924 04023 04602 04481 04701 04621 04264(s4 c0) 05325 05325 05321 04860 05089 05150 04360 04816 04870 05030 04949 04723(s4 c1) 05294 05294 05289 04753 05010 05079 04258 04750 04752 04928 04849 04588(s4 c2) 05266 05265 05259 04653 04937 05013 04164 04690 04642 04838 04761 04458(s4 c3) 05238 05236 05230 04562 04864 04948 04073 04632 04541 04747 04672 04336(s4 c4) 05211 05208 05203 04475 04798 04891 03985 04577 04440 04662 04586 04218(s4 c5) 05186 05182 05176 04392 04733 04832 03901 04524 04348 04582 04509 04109

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 29 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the smallest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 5073 5175 and 5225 respectivelyWhile the ARR of other trading algorithms decrease bymore than 100 compared with those algorithms withouttransaction cost Therefore excessive transaction cost canlead to serious losses in the accounts For a general settingof s and c ie (s c) = (002 0003) ARR of MLP DBNand SAE decrease by 2741 2797 and 2825 respectivelywhile the ARR other algorithms decrease by more than 50and that of CART NB RF and XGB decrease by more than100 Therefore MLP DBN and SAE are more tolerant totransaction cost From single trading algorithm such as SAEif we do not consider slippage ie s=0 the average ARR ofSAE is 05040 under the transaction cost structure (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not consider

transparent transaction cost ie c=0 the averageARRof SAEis 04468 under the transaction cost structures (s1 c0) (s2c0) (s3 c0) (s4 c0) so transparent transaction cost hassmaller impact than slippage Through multiple comparativeanalysis the ARR under the transaction cost structures (s0c1) (s0 c2) (s0 c3) (s0 c1) (s1 c1) are not significantlydifferent from the ARR without transaction cost for MLPDBN and SAE the ARR under all other transaction coststructures are significantly smaller than the ARR withouttransaction cost For RNN LSTM GRU CART RF LR andSVM the ARR under the transaction cost structures (s0c1) (s0 c2) (s1 c0) are not significantly different fromthe ARR without transaction cost the ARR under all othertransaction cost structures are significantly smaller than theARR without transaction cost For NB and XGB the ARRunder the transaction cost structures (s0 c1) (s1 c0) arenot significantly different from the ARR without transactioncost the ARR under all other transaction cost structuresare significantly smaller than the ARR without transactioncost

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 24: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

24 Mathematical Problems in Engineering

Table 28 The WR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05559 05565 05564 05681 05720 05717 05153 05317 05785 05809 05716 05803(s0 c1) 05523 05527 05525 05525 05608 05620 05009 05227 05612 05665 05571 05595(s0 c2) 05488 05492 05489 05389 05512 05535 04879 05149 05460 05542 05445 05411(s0 c3) 05453 05456 05452 05258 05414 05451 04747 05068 05313 05418 05320 05234(s0 c4) 05417 05419 05414 05127 05320 05368 04622 04991 05172 05297 05202 05067(s0 c5) 05383 05383 05379 05004 05230 05286 04504 04917 05036 05180 05088 04905(s1 c0) 05494 05499 05497 05444 05541 05558 04925 05170 05520 05584 05492 05488(s1 c1) 05456 05459 05456 05286 05424 05456 04775 05080 05342 05437 05345 05275(s1 c2) 05421 05423 05420 05161 05335 05377 04654 05007 05207 05320 05231 05110(s1 c3) 05386 05388 05383 05036 05246 05296 04530 04931 05065 05205 05116 04946(s1 c4) 05353 05354 05349 04915 05156 05218 04419 04861 04937 05095 05007 04795(s1 c5) 05323 05323 05317 04808 05076 05148 04315 04796 04817 04995 04905 04652(s2 c0) 05431 05434 05431 05219 05368 05403 04707 05036 05269 05374 05286 05189(s2 c1) 05395 05397 05393 05078 05266 05314 04573 04956 05115 05242 05154 05005(s2 c2) 05360 05361 05357 04960 05181 05237 04458 04886 04985 05134 05046 04853(s2 c3) 05331 05331 05326 04850 05100 05167 04352 04818 04864 05031 04945 04711(s2 c4) 05300 05300 05293 04743 05018 05093 04252 04752 04746 04931 04846 04572(s2 c5) 05273 05271 05266 04648 04946 05029 04159 04692 04639 04838 04755 04445(s3 c0) 05373 05374 05371 05019 05216 05265 04514 04917 05049 05186 05098 04932(s3 c1) 05341 05341 05336 04902 05128 05188 04399 04846 04917 05074 04990 04775(s3 c2) 05312 05312 05306 04798 05052 05122 04303 04782 04804 04977 04896 04644(s3 c3) 05281 05281 05275 04696 04976 05049 04206 04718 04689 04879 04799 04509(s3 c4) 05252 05251 05245 04598 04901 04984 04110 04657 04581 04785 04707 04378(s3 c5) 05226 05223 05218 04510 04833 04924 04023 04602 04481 04701 04621 04264(s4 c0) 05325 05325 05321 04860 05089 05150 04360 04816 04870 05030 04949 04723(s4 c1) 05294 05294 05289 04753 05010 05079 04258 04750 04752 04928 04849 04588(s4 c2) 05266 05265 05259 04653 04937 05013 04164 04690 04642 04838 04761 04458(s4 c3) 05238 05236 05230 04562 04864 04948 04073 04632 04541 04747 04672 04336(s4 c4) 05211 05208 05203 04475 04798 04891 03985 04577 04440 04662 04586 04218(s4 c5) 05186 05182 05176 04392 04733 04832 03901 04524 04348 04582 04509 04109

(2) Analysis of Impact of Transaction Cost on ARR As canbe seen from Table 29 ARR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theARR of each algorithm is the smallest Compared with thesettings without transaction cost the ARR of MLP DBNand SAE reduce by 5073 5175 and 5225 respectivelyWhile the ARR of other trading algorithms decrease bymore than 100 compared with those algorithms withouttransaction cost Therefore excessive transaction cost canlead to serious losses in the accounts For a general settingof s and c ie (s c) = (002 0003) ARR of MLP DBNand SAE decrease by 2741 2797 and 2825 respectivelywhile the ARR other algorithms decrease by more than 50and that of CART NB RF and XGB decrease by more than100 Therefore MLP DBN and SAE are more tolerant totransaction cost From single trading algorithm such as SAEif we do not consider slippage ie s=0 the average ARR ofSAE is 05040 under the transaction cost structure (s0 c1)(s0 c2) (s0 c3) (s0 c4) (s0 c5) if we do not consider

transparent transaction cost ie c=0 the averageARRof SAEis 04468 under the transaction cost structures (s1 c0) (s2c0) (s3 c0) (s4 c0) so transparent transaction cost hassmaller impact than slippage Through multiple comparativeanalysis the ARR under the transaction cost structures (s0c1) (s0 c2) (s0 c3) (s0 c1) (s1 c1) are not significantlydifferent from the ARR without transaction cost for MLPDBN and SAE the ARR under all other transaction coststructures are significantly smaller than the ARR withouttransaction cost For RNN LSTM GRU CART RF LR andSVM the ARR under the transaction cost structures (s0c1) (s0 c2) (s1 c0) are not significantly different fromthe ARR without transaction cost the ARR under all othertransaction cost structures are significantly smaller than theARR without transaction cost For NB and XGB the ARRunder the transaction cost structures (s0 c1) (s1 c0) arenot significantly different from the ARR without transactioncost the ARR under all other transaction cost structuresare significantly smaller than the ARR without transactioncost

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 25: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

Mathematical Problems in Engineering 25

Table 29 The ARR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 05728 05702 05675 05246 05162 05110 05531 06122 0484 05092 05001 04935(s0 c1) 05521 0549 05463 04522 04697 04707 04490 05072 04095 04494 04331 04044(s0 c2) 05314 05279 05251 03799 04232 04305 03450 04023 03351 03896 03662 03154(s0 c3) 05107 05068 05039 03077 03767 03904 02411 02976 02608 03299 02994 02266(s0 c4) 04901 04858 04828 02356 03303 03503 01374 01930 01866 02703 02327 01379(s0 c5) 04695 04648 04617 01636 02840 03102 00339 00886 01125 02108 01661 00493(s1 c0) 05248 05216 05186 03917 04250 04302 03437 04210 03463 03963 03746 03318(s1 c1) 05042 05005 04975 03195 03785 03900 02399 03162 02720 03366 03078 02429(s1 c2) 04835 04795 04764 02474 03321 03499 01362 02116 01978 02770 02411 01542(s1 c3) 0463 04585 04553 01754 02858 03099 00327 01072 01237 02174 01745 00656(s1 c4) 04424 04375 04342 01035 02396 02699 -00707 00029 00497 015800 01079 -00229(s1 c5) 04219 04165 04132 00317 01934 02299 -0174 -01013 -00242 00986 00415 -01113(s2 c0) 04774 04736 04704 02599 03344 03501 01363 02310 02095 02842 02500 01711(s2 c1) 04568 04526 04493 01879 02881 03100 00328 01265 01354 02247 01834 00825(s2 c2) 04363 04316 04282 01159 02419 02700 -00706 00222 00614 01652 01168 -0006(s2 c3) 04158 04107 04072 00441 01957 02301 -01739 -00820 -00125 01058 00504 -00944(s2 c4) 03953 03898 03862 -00276 01495 01902 -02770 -01861 -00863 00465 -00160 -01827(s2 c5) 03748 03689 03653 -00992 01034 01503 -03799 -02900 -01600 -00127 -00823 -02708(s3 c0) 04305 04261 04226 01289 02446 02706 -00694 00421 00737 01729 01263 00115(s3 c1) 04100 04052 04016 00570 01984 02306 -01726 -00621 -00003 01135 00598 -00769(s3 c2) 03895 03843 03806 -00147 01522 01907 -02757 -01662 -00741 00542 -00066 -01652(s3 c3) 03691 03634 03597 -00863 01062 01509 -03787 -02701 -01478 -00050 -00729 -02533(s3 c4) 03487 03426 03388 -01578 00601 01111 -04815 -03739 -02214 -00642 -01391 -03414(s3 c5) 03283 03217 03179 -02293 00142 00713 -05842 -04775 -02949 -01233 -02052 -04293(s4 c0) 03841 03791 03754 -00013 01554 01917 -02734 -01457 -00614 00623 00033 -01471(s4 c1) 03637 03582 03544 -00729 01093 01518 -03764 -02497 -01351 00031 -00630 -02353(s4 c2) 03433 03374 03335 -01445 00633 01120 -04792 -03535 -02087 -00561 -01292 -03233(s4 c3) 03229 03166 03126 -02159 00173 00723 -05819 -04572 -02823 -01152 -01953 -04113(s4 c4) 03025 02958 02918 -02873 -00286 00326 -06844 -05607 -03557 -01742 -02613 -04991(s4 c5) 02822 02751 02710 -03585 -00744 -00071 -07868 -06641 -04290 -02331 -03273 -05868

(3) Analysis of Impact of Transaction Cost on ASR As canbe seen from Table 30 ASR is decreasing with the increaseof transaction cost for any trading algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005)the ASR of each algorithm is the smallest Compared withthe settings without transaction cost the ASR of MLP DBNand SAE reduce by 4899 5011 and 5070 respectivelywhile the ASR of other trading algorithms decrease by morethan 100 compared with those without transaction costTherefore excessive transaction cost can lead to serious lossesin the accounts For a general setting of s and c ie (s c)= (002 0003) ASR of MLP DBN and SAE decrease by2601 2661 and 2694 respectively while theASR otheralgorithms decrease by more than 50 and that of CARTNB RF and XGB decrease by more than 100 ThereforeMLP DBN and SAE are more tolerant to transaction costFrom single trading algorithm such as LSTM if we do notconsider slippage ie s=0 the average ASR of LSTM is 11129under the transaction cost structures (s0 c1) (s0 c2) (s0c3) (s0 c4) (s0 c5) if we do not consider transparent

transaction cost ie c=0 the average ASR of LSTM is 08837under the transaction cost structures (s1 c0) (s2 c0) (s3c0) (s4 c0) so transparent transaction cost has smallerimpact than slippageThroughmultiple comparative analysisthe ASR under the transaction cost structures (s0 c1) (s0c2) (s0 c3) (s0 c1) (s1 c1) are not significantly differentfrom the ASR without transaction cost for MLP DBN andSAE the ASR under all other transaction cost structures aresignificantly smaller than the ASR without transaction costFor LSTM and GRU the ASR under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the ASR without transaction cost the ASRunder all other transaction cost structures are significantlysmaller than the ASR without transaction cost For RNNNB RF LR and SVM the ASR under the transaction coststructures (s0 c1) (s1 c0) are not significantly differentfrom the ASR without transaction cost the ASR under allother transaction cost structures are significantly smallerthan the ASR without transaction cost For CART and XGBthe ASR under the transaction cost structure (s0 c1) are

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 26: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

26 Mathematical Problems in Engineering

Table 30 The ASR of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 14027 14003 13931 14876 15418 15501 12229 11119 14375 15578 14227 14694(s0 c1) 13525 13488 13413 12736 14005 14268 09763 09356 12078 13697 12253 11938(s0 c2) 13019 12969 12890 10579 12578 13023 07263 07584 09763 11796 10263 09161(s0 c3) 12509 12445 12364 08411 11139 11765 04736 05804 07436 09882 08263 06372(s0 c4) 11996 11918 11834 06237 09690 10499 02191 04021 05104 07958 06255 03581(s0 c5) 11479 11388 11301 04063 08235 09224 -00364 02236 02773 06029 04244 00795(s1 c0) 12996 12953 12872 11103 12817 13133 07570 07905 10278 12127 10676 09843(s1 c1) 12486 12430 12346 08938 11379 11876 05050 06126 07955 10215 08678 07058(s1 c2) 11972 11903 11816 06766 09932 10610 02511 04343 05625 08293 06672 04269(s1 c3) 11455 11373 11282 04591 08477 09336 -00040 02558 03294 06365 04662 01483(s1 c4) 10935 10839 10746 02420 07016 08056 -02594 00775 00968 04436 02654 -01291(s1 c5) 10413 10303 10206 00257 05554 06771 -05143 -01003 -01346 02510 00651 -04045(s2 c0) 11936 11875 11785 07293 10157 10710 02851 04662 06145 08624 07084 04971(s2 c1) 1142 11345 11252 05128 08708 09441 00321 02883 03826 06707 05083 02199(s2 c2) 10901 10812 10717 02964 07253 08166 -02213 01105 01510 04787 03083 -00564(s2 c3) 10379 10277 10178 00807 05794 06887 -04745 -0067 -00797 02870 01086 -03310(s2 c4) 09854 09739 09637 -01339 04335 05605 -07267 -02437 -03088 00958 -00902 -06030(s2 c5) 09328 09199 09094 -03469 02878 04323 -09771 -04195 -05359 -00942 -02878 -08719(s3 c0) 10862 10781 10683 03537 07496 08304 -01751 01456 02086 05184 03534 00217(s3 c1) 10342 10247 10147 01393 06047 07033 -04254 -00309 -00204 03282 01550 -02509(s3 c2) 09819 09711 09607 -00742 04596 05760 -06751 -02068 -02481 01384 -00426 -05214(s3 c3) 09294 09172 09066 -02862 03146 04485 -09232 -03818 -04741 -00504 -02392 -07891(s3 c4) 08767 08632 08522 -04965 01700 03211 -11693 -05558 -06978 -02380 -04343 -10534(s3 c5) 08239 0809 07977 -07045 00258 01940 -14125 -07283 -09188 -04240 -06276 -13135(s4 c0) 09785 09684 09580 -00099 04878 05943 -06140 -01663 -01821 01862 00089 -04325(s4 c1) 09263 09148 09040 -02205 03439 04679 -08592 -03403 -04063 -00010 -01862 -06982(s4 c2) 08738 08609 08499 -04296 02003 03415 -11027 -05132 -06285 -01871 -03800 -09608(s4 c3) 08212 08070 07957 -06366 00571 02153 -13437 -06849 -08482 -03718 -05722 -12198(s4 c4) 07684 07528 07413 -08412 -00854 00894 -15818 -08551 -10652 -05547 -07625 -14747(s4 c5) 07155 06986 06868 -10431 -02271 -00359 -18162 -10236 -12788 -07356 -09505 -17248

not significantly different from the ASR without transactioncost the ASR under all other transaction cost structuresare significantly smaller than the ASR without transactioncost

(4) Analysis of Impact of Transaction Cost on MDD As canbe seen from Table 31 MDD increases with the increase oftransaction cost for any transaction algorithm Undoubtedlywhen the transaction cost is set to (s c) = (004 0005) theMDD of each algorithm increases to the highest level In thiscase compared with the setting without transaction cost theMDD of MLP DBN and SAE increase by 1031 1135and 1083 respectively The MDD of the other transactionalgorithms increases by more than 30 compared with thosewithout transaction cost Therefore excessive transactioncost can cause serious potential losses to the account For ageneral setting of s and c ie (s c) = (002 0003) the MDDof MLP DBN and SAE increase by 431 481 and 480respectively While theMDDof the other algorithms increasebymore than 20 the MDD of CART RF and XGB increase

by more than 60Therefore MLP DBN and SAE are moretolerant to transaction cost From a single trading algorithmsuch as RNN if we do not consider slippage ie s=0 theaverage MDD of RNN is 07402 under the transaction coststructures (s0 c1) (s0 c2) (s0 c3) (s0 c4) (s0 c5) if wedo not consider transparent transaction cost ie c=0 theaverage MDD of RNN is 07754 under the transaction coststructures (s1 c0) (s2 c0) (s3 c0) (s4 c0) so transparenttransaction cost has smaller impact than slippage Throughmultiple comparative analysis the MDD under most of thetransaction cost structures are not significantly different fromthe MDD without transaction cost for MLP DBN and SAEIt shows that the three algorithms have higher tolerancefor transaction cost For all trading algorithms except forMLP DBN and SAE the MDD under the transaction coststructures (s0 c1) (s0 c2) (s1 c0) are not significantlydifferent from the MDD without transaction cost the MDDunder all other transaction cost structures are significantlygreater than the MDD without transaction cost It is worthnoting that the MDD of GRU under the transaction cost

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 27: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

Mathematical Problems in Engineering 27

Table 31 The MDD of CSICS for daily trading with different transaction cost The result that there is no significant difference betweenperformance without transaction cost and that with transaction cost is in boldface

MLP DBN SAE RNN LSTM GRU CART NB RF LR SVM XGB(s0 c0) 06082 06086 06130 05648 05456 05429 05694 07469 05695 05410 05775 05632(s0 c1) 06115 06122 06168 06133 05759 05665 06272 07765 06317 05843 06249 06419(s0 c2) 06150 06163 06207 06731 06098 05922 06966 08088 07041 06353 06820 07296(s0 c3) 06188 06208 06247 07426 06468 06194 07674 08418 07777 06901 07435 08158(s0 c4) 06229 06256 06289 08083 06844 06471 08338 08728 08426 07453 08045 08858(s0 c5) 06273 06305 06333 08637 07200 06763 08887 08986 08934 07979 08563 09324(s1 c0) 06137 06145 06191 06577 06033 05870 06847 08049 06893 06265 06725 07088(s1 c1) 06174 06187 06230 07181 06384 06135 07485 08350 07556 06766 07304 07848(s1 c2) 06213 06234 06270 07818 06746 06408 08115 08641 08180 07292 07859 08542(s1 c3) 06255 06282 06313 08413 07107 06680 08670 08890 08721 07797 08387 09087(s1 c4) 06298 06331 06359 08884 07451 06964 09104 09099 09134 08267 08828 09455(s1 c5) 06343 06382 06406 09237 07776 07254 09432 09269 09426 08674 09169 09684(s2 c0) 06214 06230 06269 07549 06700 06369 07815 08546 07857 07131 07661 08131(s2 c1) 06256 06277 06312 08084 07032 06627 08327 08785 08387 07597 08138 08688(s2 c2) 06299 06327 06357 08579 07350 06887 08793 08998 08851 08037 08576 09142(s2 c3) 06344 06379 06406 08991 07664 07163 09174 09179 09207 08449 08955 09473(s2 c4) 06391 06431 06456 09305 07963 07444 09467 09335 09468 08802 09250 09690(s2 c5) 06443 06487 06511 09528 08230 07721 09667 09457 09650 09091 09471 09820(s3 c0) 06299 06320 06357 08218 07242 06808 08419 08857 08488 07794 08291 08725(s3 c1) 06345 06373 06406 08645 07528 07063 08839 09047 08891 08181 08667 09131(s3 c2) 06394 06427 06459 09018 07812 07325 09188 09216 09217 08538 08998 09442(s3 c3) 06446 06481 06514 09313 08084 07591 09461 09361 09463 08857 09271 09661(s3 c4) 06500 06542 06572 09529 08329 07859 09656 09481 09642 09122 09481 09801(s3 c5) 06561 06610 06634 09681 08555 08113 09789 09576 09764 09338 09633 09885(s4 c0) 06399 06432 06460 08670 07666 07240 08832 09079 08893 08270 08710 09087(s4 c1) 06453 06496 06519 09005 07926 07490 09165 09242 09197 08585 09005 09388(s4 c2) 06511 06561 06583 09290 08169 07741 09433 09382 09435 08877 09262 09611(s4 c3) 06573 06630 06649 09508 08399 07989 09629 09497 09615 09128 09467 09766(s4 c4) 06640 06704 06719 09664 08611 08225 09768 09591 09744 09331 09619 09863(s4 c5) 06709 06777 06794 09774 08804 08445 09862 09665 09831 09498 09730 09921

structure (s1 c1) is not significantly different from the MDDwithout transaction cost

Through the Table 31 analysis we find that trading per-formance will become worse and worse with the increaseof transaction cost Moreover excessive transaction costmay cause huge losses Especially for some traditional MLalgorithm the ARR andASR of those algorithms will becomenegative MDD of the algorithms will become close to 100when transaction cost is increasing DNN models especiallyMLP DBN and SAE are more tolerant to the changes oftransaction cost and are more suitable for actual tradingactivities Meanwhile the experimental results indicate thatthe impact of slippage on trading performance is greaterthan the transparent transaction cost because the pricesof CSICS are generally small We conclude that a certainpercentage of turnover will generate smaller transaction costThrough multiple comparative analysis we find that theperformance of these algorithms under most of transactioncost structures may be significantly worse than those withoutconsidering transaction cost The finding shows that the

trading performance of these algorithms is very sensitive totransaction cost which needs to be paid enough attention toin actual trading activities

7 Discussion

Forecasting the future ups and downs of stock prices andmaking trading decisions are always challenging tasks How-ever more and more investors are attracted to participate intrading activities by high return of stockmarket and high riskpromotes investors to try their best to construct profitabletrading strategies Meanwhile the fast changing of financialmarkets the explosive growth of big financial data theincreasing complexity of financial investment instrumentsand the rapid capture of trading opportunities provide moreand more research topics for academic circles In this paperwe apply some popular and widely used ML algorithms to dostock trading Our purpose is to explore whether there aresignificant differences in stock trading performance amongdifferent ML algorithms Moreover we study whether we can

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 28: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

28 Mathematical Problems in Engineering

find highly profitable trading algorithms in the presence oftransaction cost

Financial data which is generated in changing financialmarket are characterized by randomness low signal-to-noiseratio nonlinearity and high dimensionality Therefore it isdifficult to find inherent patterns in financial big data by usingalgorithms In this paper we also prove this point

When using ML algorithms to predict stock prices thedirectional evaluation indicators are not as good as expectedFor example the AR PR and RR of LSTM and RNN areabout 50-55 which are only slightly better than randomguess On the contrary some traditional ML algorithms suchas XGB have stronger ability in directional predictions ofstock prices Therefore those simple models are less likelyto cause overfitting when capturing intrinsic patterns offinancial data and can make better predictions about thedirections of stock price changes Actually we assume thatsample data are independent and identically distributedwhenusing ML algorithm to classify tasks DNN algorithms suchas LSTM and RNN make full use of autocorrelation offinancial time series data which is doubtful because of thecharacteristics of financial data Therefore the predictionability of these algorithms may be weakened because of thenoise of historical lag data

From the perspective of trading algorithms traditionalML models map the feature space to the target space Theparameters of the learning model are quite few Thereforethe learning goal can be better accomplished in the case offewer data The DNN models mainly connect some neuronsinto multiple layers to form a complex DNN structureThrough the complex structure the mapping relationshipsbetween input and output are established As the numberof neural network layers increases the weight parameterscan be automatically adjusted to extract advanced featuresCompared with the traditional ML models DNN modelshavemore parameters So their performance tends to increaseas the amount of data grows Complex DNN models need alot of data to avoid underfitting and overfitting However weonly use the data for 250 trading days (one year) as trainingset to construct trading model and then we predict stockprices in the next week So too few data may lead to poorperformance in the directional and performance predictions

In the aspect of transaction cost it is unexpected thatDNN models especially MLP DBN and SAE have strongeradaptability to transaction cost than traditional ML modelsIn fact the higher PR of MLP DBN and SAE indicate thatthey can identify more trading opportunities with higherpositive return At the same time DNN model can adaptto the changes of transaction cost structures well That iscompared with traditional MLmodels the reduction of ARRand ASR of DNN models are very small when transactioncost increases There especially is no significant differencebetween theMDDofDNNmodels undermost of transactioncost structures and that without considering transaction costThis is further proof that DNNmodels can effectively controldownside risk Therefore DNN algorithms are better choicesthan traditional ML algorithm in actual transactions In thispaper we divide transaction cost into transparent transactioncost and implicit transaction cost In different markets

the impact of the two transaction cost on performance isdifferent We can see that transparent transaction cost is alarger impact than implicit transaction cost in SPICS whilethey are just the opposite in CSICS because the prices ofSPICS are higher than that of CSICSWhile we have taken fullaccount of the actual situation in real trading the assumptionof transaction cost in this paper is relatively simpleThereforewe can consider the impact of opportunity cost and marketimpact cost on trading performance in future research work

This paper makes a multiple comparative analysis oftrading performance for differentML algorithms bymeans ofnonparameter statistical testing We comprehensively discusswhether there are significant differences among the algo-rithms under different evaluation indicators in both casesof transaction cost and no transaction cost We show thatthe DNN algorithms have better performance in terms ofprofitability and risk control ability in the actual environmentwith transaction cost Therefore DNN algorithms can beused as choices for algorithmic trading and quantitativetrading

8 Conclusion

In this paper we apply 424 SPICS in the US market and185 CSICS in the Chinese market as research objects selectdata of 2000 trading days before December 31 2017 andbuild 44 technical indicators as the input features for the MLalgorithms and then predict the trend of each stock price astrading signal Further we formulate trading strategies basedon these trading signals and we do backtesting Finally weanalyze and evaluate the trading performance of these algo-rithms in both cases of transaction cost and no transactioncost

Our contribution is to compare the significant differencesbetween the trading performance of the DNN algorithms andthe traditional ML algorithms in the Chinese stock marketand the American stock market The experimental results inSPICS and CSICS show that some traditional ML algorithmshave a better performance than DNN algorithms in most ofthe directional evaluation indicators DNN algorithms whichhave the best performance indicators (WR ARR ASR andMDD) among all ML algorithms are not significantly betterthan those traditional ML algorithms without consideringtransaction cost With the increase of transaction cost thetransaction performance of all ML algorithms will becomeworse and worse Under the same transaction cost structurethe DNN algorithms especially the MLP DBN and SAEhave lower performance degradation than the traditional MLalgorithm indicating that the DNN algorithms have a strongtolerance to the changes of transaction cost Meanwhile thetransparent transaction cost and implicit transaction cost aredifferent impact for the SPICS and CSICS The experimentalresults also reveal that the transaction performance of all MLalgorithms is sensitive to transaction cost andmore attentionis needed in actual transactions Therefore it is essential toselect the competitive algorithms for stock trading accordingto the trading performance adaptability to transaction costand the risk control ability of the algorithms both in theAmerican stock market and Chinese A-share market

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 29: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

Mathematical Problems in Engineering 29

With the rapid development of ML technology and theconvenient access to financial big data future research workcan be carried out from the following aspects (1) usingML algorithms to implement dynamic optimal portfolioamong different stocks (2) using ML algorithms to do high-frequency trading and statistical arbitrage (3) consideringthe impact of more complex implicit transaction cost suchas opportunity cost and market impact cost on stock tradingperformance The solutions of these problems will help todevelop an advanced and profitable automated trading sys-tem based on financial big data including dynamic portfolioconstruction transaction execution cost control and riskmanagement according to the changes of market conditionsand even the changes of investorrsquos risk preferences of overtime

Data Availability

We have shared our data availability (software codes andexperimental data) in a website and can be found at httpsfigsharecomaccountarticles7238345

Conflicts of Interest

The authors declare that they have no conflicts of interest

Acknowledgments

This work was supported in part by the National NaturalScience Foundation of China (nos 71571136 61802258) inpart by Technology Commission of Shanghai Municipality(no 16JC1403000)

Supplementary Materials

The supplementary materials submitted along with our man-uscript include program codes of every algorithm datasetsand the main result of this work The materials havebeen uploaded to the Figshare database (httpsdoiorg106084m9figshare7569032) (Supplementary Materials)

References

[1] R C Cavalcantea R C Brasileirob V F Souzab J P Nobregaband A I Oliveir ldquoComputational intelligence and financialmarkets a survey and future directionsrdquo Expert Systems withApplications vol 55 pp 194ndash211 2016

[2] W Huang Y Nakamori and S-Y Wang ldquoForecasting stockmarket movement direction with support vector machinerdquoComputers ampOperations Research vol 32 no 10 pp 2513ndash25222005

[3] J Chen ldquoSVM application of financial time series forecastingusing empirical technical indicatorsrdquo in Proceedings of the Inter-national conference on information networking and automationICINA rsquo10 pp 1ndash77 China October 2010

[4] C Q Xie ldquoThe optimization of share price prediction modelbased on support vector machinerdquo in Proceedings of the Inter-national conference on control automation and systems engineer-ing CASE rsquo11 pp 1ndash4 Singapore July 2011

[5] P Ladyzynski K Zbikowski and P Grzegorzewski ldquoStocktrading with random forests trend detection tests and forceindex volume indicatorsrdquo in Proceedings of the InternationalConference onArtificial Intelligence and Soft Computing ICAISCrsquo13 pp 441ndash452 Poland June 2013

[6] J Zhang S Cui Y Xu Q Li and T Li ldquoA novel data-driven stockprice trend prediction systemrdquo Expert Systems withApplications vol 97 pp 60ndash69 2018

[7] D Ruta ldquoAutomated trading with machine learning on bigdatardquo in Proceedings of the 3rd IEEE International Congress onBig Data BigData Congress rsquo14 pp 824ndash830 USA July 2014

[8] J Patel S Shah P Thakkar and K Kotecha ldquoPredicting stockand stock price index movement using trend deterministic datapreparation and machine learning techniquesrdquo Expert Systemswith Applications vol 42 no 1 pp 259ndash268 2015

[9] L Luo and X Chen ldquoIntegrating piecewise linear representa-tion and weighted support vector machine for stock tradingsignal predictionrdquo Applied Soft Computing vol 13 no 2 pp806ndash816 2013

[10] K Zbikowski ldquoUsing volume weighted support vector ma-chines with walk forward testing and feature selection for thepurpose of creating stock trading strategyrdquo Expert Systems withApplications vol 42 no 4 pp 1797ndash1805 2015

[11] RDash andP KDash ldquoA hybrid stock trading framework inte-grating technical analysis with machine learning techniquesrdquoThe Journal of Finance and Data Science vol 2 no 1 pp 42ndash57 2016

[12] M Gorenc Novak and D Veluscek ldquoPrediction of stock pricemovement based on daily high pricesrdquo Quantitative Financevol 16 no 5 pp 793ndash826 2015

[13] R Cervello-Royo ldquoStock market trading rule based on patternrecognition and technical analysis forecasting the DJIA indexwith intraday datardquo Expert Systems with Applications vol 42no 14 pp 5963ndash5975 2015

[14] R C Brasileiro V L F Souza and A L I Oliveira ldquoAutomatictrading method based on piecewise aggregate approximationand multi-swarm of improved self-adaptive particle swarmoptimization with validationrdquo Decision Support Systems vol104 pp 79ndash91 2017

[15] Y Chen and X Wang ldquoA hybrid stock trading system usinggenetic network programming and mean conditional value-at-riskrdquo European Journal of Operational Research vol 240 no 3pp 861ndash871 2015

[16] L S Malagrino N T Roman and A M Monteiro ldquoFore-casting stock market index daily direction a bayesian networkapproachrdquo Expert Systems with Applications vol 105 pp 11ndash222018

[17] W Bao J Yue and Y L Rao ldquoA deep learning framework forfinancial time series using stacked autoencoders and long shorttermmemoryrdquo PLoS ONE vol 12 no 7 pp 1ndash24 2017

[18] FThomas and K Chrisstopher ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[19] N Makickiene A V Rutkauskas and A Maknickas ldquoInves-tigation of financial market prediction by recurrent neuralnetworkrdquo Innovative Info Technologies for Science Business andEducation vol 2 no 11 pp 1ndash24 2011

[20] L D Persio ldquoRecurrent neural networks approach to thefinancial forecast of Google assetsrdquo International Journal ofMathematics and Computers in Simulation vol 11 pp 1ndash7 2017

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 30: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

30 Mathematical Problems in Engineering

[21] C L Dunis J Laws and B Evans ldquoTrading futures spreadportfolios applications of higher order and recurrent networksrdquoEuropean Journal of Finance vol 14 no 6 pp 503ndash521 2008

[22] E Chong C Han and F C Park ldquoDeep learning networks forstockmarket analysis and prediction methodology data repre-sentations and case studiesrdquo Expert Systems with Applicationsvol 83 pp 187ndash205 2017

[23] C Krauss A Do and N Hucket ldquoDeep neural networksgradient-boosted trees random forests statistical arbitrage onthe S and P500rdquo European Journal of Operational Research vol259 pp 689ndash702 2017

[24] T-J Hsieh H-F Hsiao andW-C Yeh ldquoForecasting stockmar-kets using wavelet transforms and recurrent neural networksan integrated system based on artificial bee colony algorithmrdquoApplied Soft Computing vol 11 no 2 pp 2510ndash2525 2011

[25] M Langkvist L Karlsson and A Loutfi ldquoA review of unsu-pervised feature learning and deep learning for time-seriesmodelingrdquo Pattern Recognition Letters vol 42 no 1 pp 11ndash242014

[26] V Vella and W L Ng ldquoEnhancing risk-adjusted performanceof stock market intraday trading with Neuro-Fuzzy systemsrdquoNeurocomputing vol 141 pp 170ndash187 2014

[27] W Liu Z Wang X Liu N Zeng Y Liu and F E AlsaadildquoA survey of deep neural network architectures and theirapplicationsrdquo Neurocomputing vol 234 pp 11ndash26 2017

[28] MDixon ldquoSequence classification of the limit order book usingrecurrent neural networksrdquo Journal of Computational Sciencevol 24 pp 277ndash286 2018

[29] H Y Kim and C H Won ldquoForecasting the volatility of stockprice index A hybrid model integrating LSTM with multipleGARCH-type modelsrdquo Expert Systems with Applications vol103 pp 25ndash37 2018

[30] G Shen Q Tan H Zhang P Zeng and J Xu ldquoDeep learningwith gated recurrent unit networks for financial sequencepredictionsrdquo Procedia Computer Science vol 131 pp 895ndash9032018

[31] O B Sezer M Ozbayoglu and E Dogdu ldquoA deep neural-network based stock trading system based on evolutionaryoptimized technical analysis parametersrdquo Procedia ComputerScience vol 114 pp 473ndash480 2017

[32] H P Hu L Tang S H Zhang and H Y Wang ldquoPredictingthe direction of stockmarkets using optimized neural networkswith Google Trendsrdquo Neurocomputing vol 285 pp 188ndash1952018

[33] T Fischer and C Krauss ldquoDeep learning with long short-term memory networks for financial market predictionsrdquo FauDiscussion Papers in Economics vol 270 no 2 pp 1ndash32 2017

[34] D D Lv Z H Huang M Z Li and Y Xiang ldquoSelection ofthe optimal trading model for stock investment in differentindustriesrdquo PLoS ONE vol 14 no 2 2019

[35] R PardoTheEvaluation andOptimization of Trading StrategiesJohn Wiley and Sons Hoboken New Jersey NJ USA 2ndedition 2008

[36] B LantzMachine Learning with R Packt Publishing Birming-ham UK 2nd edition 2015

[37] I Aldridge High-Frequency Trading A Practical Guide toAlgorithmic Strategies and Trading Systems John Wiley andSons Hoboken New Jersey NJ USA 2nd edition 2014

[38] M Hollander and D A Wolfe Nonparametric Statistical Meth-ods JohnWiley and Sons Hoboken New Jersey NJ USA 1973

[39] P B Nemenyi Distribution-free multiple comparisons [PhDdissertations] State University of New York 1963

[40] BaiKe ldquoSecurities Transaction costrdquo 2018 httpsbaikebaiducomitem

[41] GuCheng ldquoHow to calculate the transaction cost of Ameri-can stockrdquo SouthMoney 2016 httpwwwsouthmoneycomzhishigprm970810html

[42] JMoody LWu Y Liao andM Saffell ldquoPerformance functionsand reinforcement learning for trading systems and portfoliosrdquoJournal of Forecasting vol 17 no 56 pp 441ndash470 1998

[43] JoinQuant ldquoWhite Horse Stock Strategyrdquo Xueqiu 2017 httpsxueqiucom828784012087475118

[44] Abu ldquoQuantitative Investment Slippage Strategy and Transac-tion Costrdquo Chinese Software Developer Network (CSDN) 2017httpsblogcsdnnetbbfamily1314articledetails78284986

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom

Page 31: An Empirical Study of Machine Learning Algorithms for ...downloads.hindawi.com/journals/mpe/2019/7816154.pdf · the +1-th trading day relative to the -th trading day. at is, if the

Hindawiwwwhindawicom Volume 2018

MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Mathematical Problems in Engineering

Applied MathematicsJournal of

Hindawiwwwhindawicom Volume 2018

Probability and StatisticsHindawiwwwhindawicom Volume 2018

Journal of

Hindawiwwwhindawicom Volume 2018

Mathematical PhysicsAdvances in

Complex AnalysisJournal of

Hindawiwwwhindawicom Volume 2018

OptimizationJournal of

Hindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom Volume 2018

Engineering Mathematics

International Journal of

Hindawiwwwhindawicom Volume 2018

Operations ResearchAdvances in

Journal of

Hindawiwwwhindawicom Volume 2018

Function SpacesAbstract and Applied AnalysisHindawiwwwhindawicom Volume 2018

International Journal of Mathematics and Mathematical Sciences

Hindawiwwwhindawicom Volume 2018

Hindawi Publishing Corporation httpwwwhindawicom Volume 2013Hindawiwwwhindawicom

The Scientific World Journal

Volume 2018

Hindawiwwwhindawicom Volume 2018Volume 2018

Numerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisNumerical AnalysisAdvances inAdvances in Discrete Dynamics in

Nature and SocietyHindawiwwwhindawicom Volume 2018

Hindawiwwwhindawicom

Dierential EquationsInternational Journal of

Volume 2018

Hindawiwwwhindawicom Volume 2018

Decision SciencesAdvances in

Hindawiwwwhindawicom Volume 2018

AnalysisInternational Journal of

Hindawiwwwhindawicom Volume 2018

Stochastic AnalysisInternational Journal of

Submit your manuscripts atwwwhindawicom


Recommended