The stock market price forecasting based on combined methods of machine learning

Analysis of the problems of developing adequate trading strategy based on predicting the future values of stocks and indices, using linear and nonlinear models ARIMA, ANN. Assessing the impact of the merger on the method of projections for both indices.

Рубрика Банковское, биржевое дело и страхование
Вид курсовая работа
Язык английский
Дата добавления 30.08.2016
Размер файла 669,4 K

Отправить свою хорошую работу в базу знаний просто. Используйте форму, расположенную ниже

Студенты, аспиранты, молодые ученые, использующие базу знаний в своей учебе и работе, будут вам очень благодарны.

1,37

1,39

0,107372

Next, we chose for each data sample the most appropriate random forest model with specific input data. The criterion is the minimal MAPPE for testing period 1. It allowed us to estimate the chosen models for trading in testing period two ex-ante, as if we did not know the actual values. Table 11 shows the chosen approaches for each Index.

Table 11. Chosen data inputs for future trading

Data frame

Data input in random forest

Russian MICEX O&G Index

ANN, Lags=5,7

EMA

SMMA

LWMA

Momentum

American Dow Jones U.S. Oil and Gas index

ARIMA, N=91

SMMA

EMA

LWMA

3.6 Trading simulation

In this section, we present our results of trading. Our aims of this section are:

· To determine the profitability of proposed trading strategies;

· To identify the potential of trading strategies basing on testing period one for testing period two;

· To compare the evaluation metrics of our trading strategies with buy and sell signals with simple buy-and-hold;

Next subsections present the decisions of proposed problem sets.

Trading with buy transaction costs equal 0.005 and G equals zero

Table 12. Experiment results with proposed trading strategies for MICEX O&G Index

Buy-and-hold

Trading strategy with buy signals*

Trading strategy with sell signals*

Testing period 1

Testing period 2

Testing period 1

Testing period 2

Testing period 1

Testing period 2

N

1

1

99

97

99

98

Profit

137,2086

1276,448

3251,39

5216,46

3043,52

4449,17

DD

8,8019

4,195

6,24

11,50

8,80

4,41

Sharp

0,2659

5,163

0,53

5,52

0,47

4,91

-

-

0,01

0,01

0,01

0,02

*For transaction costs and

Table 13. Experiment results with proposed trading strategies for Dow Jones U.S. Oil and Gas index

Buy-and-hold

Trading strategy with buy signals*

Trading strategy with sell signals*

Testing period 1

Testing period 2

Testing period 1

Testing period 2

Testing period 1

Testing period 2

N

1

1

82

62

81

63

Profit

92,8641

-157,545

236,84

189,21

123,73

317,92

DD

4,2344

6,495

5,52

19,41

4,23

6,49

Sharp

6,6113

-9,678

6,25

-6,64

4,27

-8,78

-

-

0,008

0,012

0,01

0,02

*For transaction costs and

To achieve the proposed goals, we firstly simulated trading strategies and buy-and hold. The results and the values of evaluation metrics are presented in Tables 12 and 13.

In the Tables 12 and 13, for buy transactions and for sell transactions. This measure shows the level of transaction costs that eliminates the profit from trading.

For Russian Index, the results are quite promising. The profits from each trading strategy are higher than for simple buy-and-hold, and for testing period 2 are significantly higher. As for other metrics, the rising DD and Sharp for testing period two make us suppose that buying strategy is risky and not stable, returns from the strategy do not justify risks. However, as drawdown is no more than 11%, we can lose only 11% of our investment. As for selling strategy, the metrics are impressive and indicate that our strategy is successful.

Based on the results of DJIAO&G, we observe negative Sharp coefficients for testing period 2, it indicates that both strategies are not adequate and we cannot use them for trading. Moreover, the profit of buy-and-hold strategy for testing period 2 is negative and we can conclude that for such situation on the market as we observe for this period, no traders will use strategies.

Varying G for buying strategy to determine profits and transactions costs, eliminating them.

In the previous subsection, we proposed and . The value of sets the level of difference between today's close price and tomorrow's predicted price. Thus, has a direct impact on the frequency with which the transactions will be made. It can be seen from tables X and X that the number of deals when is very high, however we can gain more profit if we make transactions with another value of . What is more, the parameter has an influence on the level of transaction cost that eliminates the profit from trading. Defining different values of , we looked at distribution of closing prices for testing period 1.

Thus, we built tables that show different values of for our trading strategies and appropriate evaluation metrics. The tables are given for testing period 1, as if we are in this period and want to choose the value of for trading in the next period, testing period 2. In addition, tables 14 and 15 illustrates only best results of trading in terms of maximum profits and the most adequate levels of DD and Sharp metrics. The whole results are presented in Appendices C and D.

Table 14. Best results from varying values of and corresponding evaluation metrics for MICEX O&G Index, buying strategy

G

N

Profit, rub

DD, %

Sharp, %

0

99

3251,39

0,0100

6,2476

0,5329

5

97

3455,63

0,0109

6,5439

0,1397

10

94

3658,44

0,0119

6,3520

0,1831

15

80

3477,91

0,0133

6,6817

0,1360

20

72

3394,57

0,0144

6,6817

0,1490

25

61

3077,62

0,0155

6,6817

0,0126

30

56

2905,72

0,0160

6,6817

0,8427

35

47

2676,63

0,0176

6,5566

0,8521

40

38

2338,58

0,0193

6,5319

0,8932

45

32

2066

0,0201

6,5319

0,9110

50

24

1779,91

0,0233

6,5319

0,8201

In can be seen form table 14, that the most appropriate values of To declare such statement, we looked at the highest profits and the most adequate levels of DD and Sharp metrics. It should be mentioned, that the level of transaction costs that eliminates profit is higher than the intrinsic level, existing on the markets.

Table 15. Best results from varying values of and corresponding evaluation metrics for DJIAO&G index

G

N

Profit,$

DD, %

Sharp, %

0,00

82

236,84

0,0084

5,5273

6,2596

0,10

84

236,65

0,0082

5,5273

6,2629

0,20

82

237,16

0,0084

5,5273

6,2646

0,30

80

237,94

0,0086

6,0105

6,0876

0,40

81

244,39

0,0088

6,0105

6,1191

0,50

84

238,02

0,0082

6,0105

6,1452

4,50

37

121,07

0,0095

4,6977

7,3818

4,60

34

114,92

0,0099

4,1866

7,8494

4,70

33

107,49

0,0096

4,1863

7,7328

4,80

32

100,26

0,0092

4,1863

8,0346

4,90

29

97,71

0,0094

4,1863

7,6945

5,00

28

94,53

0,0099

4,1863

7,5901

For DJIAO&G, the most appropriate values of After the statement of the most profitable values of , we used them for testing period 2 as we did not know future values and suggested that with the proposed values of we would gain the same profits in the future. The results can be seen in Tables 16 and 17.

Table 16. The results from buying trading strategy in the future for chosen values of , MICEX O&G Index.

G

N

Profit, rub

DD, %

Sharp, %

0

97

5216,46

0,0133

11,4983

5,4814

15

92

6267,65

0,0168

11,4983

5,5944

45

59

5328,76

0,0226

10,7270

5,9541

50

51

5175,63

0,0253

10,7270

5,9716

Table 16 presents the results after trading in testing period 2 for Russian Index. It should be noted, that such evaluation metrics as drawdown and Sharp ratio are higher than for testing period 1, but the achieved profits are higher too. All in all, it can be said that the proposed strategy allow us to gain positive high profit after trading. Graphically, the processes of buying can be presented as Graph 5. In Graph 5, we illustrated the actual values of closing prices and cumulative profits (depending on each value of ) during the whole period of trading.

Figure 5. The dynamics of buying strategy for testing period 2, MICEX O&G

As it was noted earlier, the buying strategy is not adequate for trading in the future basing on DJIAO&G data. Table 16 shows the same statement: varying, we cannot achieve accurate results from trading. The Sharp ratio is negative for all values of , thus, the profit, achieved during the trading, does not cover risks, that we have, trading in this market. Moreover, the fact, that we had a profit in testing period 2 for American market, is surprising and, likely, random.

Table 17. Results for trading in the future for chosen values of, DJIAO&G index.

G

N

Profit,$

DD, %

Sharp, %

0,30

62

183,19

0,0100

17,5152

-6,7890

0,40

61

178,84

0,0099

17,5152

-6,8638

4,70

33

196,01

0,0202

14,4802

-6,6695

Figure 6. The dynamics of buying strategy for testing period 2, DJIAO&G index

Varying G for selling strategy to determine profits and transactions costs, eliminating them.

For selling strategy, we wanted to demonstrate the changes in evaluation metrics and transaction costs as it was made for buying strategy, varying . The results for both indices are presented in tables 18 and 20. In addition, tables 18 and 20 illustrates only best results of trading in terms of maximum profits and the most adequate levels of DD and Sharp metrics. The whole results are presented in Appendices E and F.

Table 18. Best results from varying values of and corresponding evaluation metrics for MICEX O&G Index, selling strategy

G

N

Profit, rub

DD, %

Sharp, %

12

86

3739,57

0,0134

8,8019

0,1717

14

84

3721,22

0,0137

8,8019

0,1811

16

83

3664,28

0,0136

9,3082

0,1127

18

83

3646,27

0,0135

9,3082

0,0877

42

31

2089,43

0,0210

6,0234

0,5019

44

29

2019,44

0,0216

6,0234

0,4859

46

26

1877,48

0,0247

6,0234

0,5010

48

24

1760,65

0,0227

6,0234

0,4895

50

21

1598,14

0,0239

7,0564

0,4854

52

18

1414,42

0,0245

7,0561

0,4841

54

15

1181,45

0,0248

7,0561

0,4514

56

14

1094,43

0,0247

7,0561

0,6111

58

11

1031,95

0,0301

7,0561

0,6198

60

9

859,72

0,0307

7,0561

0,7893

In can be seen form table 18, that the most appropriate values of As it was made earlier, we looked at the highest profit and the most adequate levels of drawdown and Sharp. Next, we traded in the market with the proposed values of . The results are shown in table 19.

Table 19. The results from selling trading strategy in the future for chosen values of , MICEX O&G Index

G

N

Profit, rub

DD, %

Sharp, %

14

93

4933,93

-0,0131

4,1952

4,9003

50

50

4143,27

-0,0203

4,8298

4,2824

As it was expected, after trading we gained positive high profit and other metrics lie within the acceptable values. The observed strategy is successful and profitable for Russian Index MICEX O&G.

Figure 7. The dynamics of selling strategy for testing period 2, MICEX O&G

Table 20. The results from varying values of and corresponding evaluation metrics for American Dow Jones U.S. Oil and Gas index

G

N

Profit,$

DD, %

Sharp, %

0,2

79

139,91

0,0052

4,2344

4,2205

0,3

78

136,75

0,0051

4,2344

4,1806

0,4

78

147,09

0,0055

4,2344

4,1756

0,5

78

157,99

0,0059

4,2344

4,1996

0,6

77

162,05

0,0062

4,2344

4,1544

1,2

71

172,52

0,0071

4,2344

3,9484

1,3

71

171,12

0,0070

4,2344

3,9705

1,4

69

169,41

0,0071

4,2344

3,9697

1,5

66

175,23

0,0077

4,2344

3,7746

1,6

64

175,34

0,0080

4,2344

3,8654

1,7

63

175,21

0,0081

4,2344

3,9149

1,8

62

164,13

0,0077

4,2344

4,0942

1,9

62

160,99

0,0075

4,2344

4,1206

2

60

156,07

0,0075

4,2344

4,0774

Basing on table 20, we can say that the values of Sharp and DD metrics are quite high, however the most accurate levels ofNext, as it was made earlier, we traded in the market with the given levels of in the future.

Table 21. The results from selling trading strategy in the future for chosen values of , American Dow Jones U.S. Oil and Gas index.

G

N

Profit,$

DD, %

Sharp, %

0,40

65

333,5382

0,01731

6,4950

-8,7831

1,50

64

348,9096

0,01819

6,4950

-8,7253

1,60

64

342,2239

0,01784

6,4950

-8,7520

Analyzing the results, given in table 21, we concluded that trading strategy with sell signals is not adequate for American Dow Jones U.S. Oil and Gas index due to inappropriate level of Sharp metric. Despite the fact that the profits are positive, it is very risky to use this strategy for real trading.

Figure 8. The dynamics of selling strategy for testing period 2, American Dow Jones U.S. Oil and Gas index

It can be seen from the Graph 8, that the strategy hardly can gain any profit from the trading and cannot adopt to the varying trends. We observed that in most cases, using this strategy, we failed in getting profit from decline or raise of the Index.

All in all, it is difficult to compare two indices because of different trends in testing period two: Russian Index has a rapid raise, while DJIAO&G, in contrast, has a sudden fall. However, inside each data sample, we can compare two proposed trading strategies, with buy and sell signals respectively.

For Russian Index, firstly we observed Sharp ratio less that one for both strategies that means our trading is not such effective, as we wanted it to be. The profits are positive, however they are not as high as we expected. After establishing the most profitable values of , we traded in testing period 2, using our predicted values of prices, training on past training period. As a result, we gained profits higher than 4100 rubles for selling strategy and 5000 for buying strategy. The Sharp ratios are higher than 4,2 for both strategies, that means our probability of having loss is less than 1%. However, the , thus, our maximum size of probable losses is 11,5% of current income. It is a risk traded has, trading in the Russian market with MICEX O&G Index. Comparing two strategies between each other, we state that buying strategy is more profitable than selling, but more risky too. All in all, both strategies are profitable and their potential is promising and deserves future research. Moreover, the profits and other metrics, given for proposed trading strategies MICEX O&G, are better than for simple buy-and-hold.

As for DJIAO&G, the strategies are not as effective as we expected. For testing period one, we observed positive profits more than 200 dollars for each strategy, and Sharp ratios were more than 4, that means our probability of having loss is less than 1%. The potential of both strategies was great; although this situation can be appeared due to stable growth is testing period one. However, all metrics turned low, the profits are not so high as they used to be, Sharp ratios are negative, that means our strategies are not adequate for this period. All in all, we concluded, that for American Index, all strategies, included simple buy-and-hold, are not adequate and can be realized due to sharp recession in the market.

As for other intermediate results, particularly for transaction costs, eliminating profits, we found that they are higher than intrinsic levels, existing on the markets. Thus, we concluded, that trading in the market in fact, our real profits and other metrics should be close to results, given in this research.

Conclusion

The task focused in this paper is to predict stock price indices accurately and use these predictions in developing profitable trading strategies. Predictions were performed using random forest regression as a novel fusion technique, combining predictions from two most widespread models namely ARIMA and ANN. In additions, eight technical indicators reflecting the condition of stock and stock price index were used to improve each of these models. Next, basing on accurate predicted data of fusion technique, two trading strategies were presented, allowing having profits from proposed predictions. The results for proposed trading strategies were compared with simple buy-and-hold to demonstrate their potential.

Experiments were carried out on seven years of historical data of two indices namely MICEX O&G and Dow Jones U.S. Oil and Gas Index from Russian and American stock markets respectively.

As for prediction performance, totally 72 specifications of ARIMA and ANN were build depending on different parameters of these models. The individual predictions were compared with fusion predictions, and the results show, that for both indices, fusion modeling significantly improve the predictive ability of proposed models. In addition, the predictions are more accurate for American Index, as it more developed and trends are more predictable.

Next, we created buy-and-hold and two trading strategies with buy and sell signals respectively, using predicted, close and open prices for both indices. Experiments illustrates, that for both indices our strategies show higher profits and they are the same as risky as buy-and-hold. However, for American Index we found inadequate results, particularly negative Sharp ratios for both strategies. This means we cannot trade in this market with such strategies and even with buy-and-hold. However, for Russian Index the results are quite promising. We gained profits higher than 4100 rubles for selling strategy and 5000 for buying strategy. The Sharp ratios are higher than 4,2 for both strategies, that means our probability of having loss is less than 1%. Comparing two strategies between each other, we state that buying strategy is more profitable than selling, but more risky too.

The proposed trading strategies have transaction costs higher than intrinsic levels, existing on the markets. Thus, trading in the market in fact, our real profits and other metrics should be close to results, given in this research.

As for future work, other machine learning approaches may also be considered, such as support vector machines, linear gradient boosting machine, GBM. Furthermore, rather than using technical indicator rules existing in the literature directly, fuzzified versions of these rules may be constructed and utilized. Since none of the existing technical indicator rules are claimed to be perfect, they are always subject to criticism. Thus, in real life financial market traders do not use any one of them alone to make their real decisions. In addition, it is appealing to consider the case of trading strategy with both buy and sell signals, ability of trading with more than one index/stock. Moreover, the results of trading will be more broad and reliable, if the initial capital is included.

Размещено на Allbest.ru


Подобные документы

  • The behavior of traders on financial markets. Rules used by traders to determine their trading policies. A computer model of the stock exchange. The basic idea and key definitions. A program realization of that model. Current and expected results.

    реферат [36,7 K], добавлен 14.02.2016

  • Description of exchange stocks as financial point-of-sale platforms. Description of point-of-sale algorithm of broker trade at the financial market. Parameters of price gaps on financial auctions and optimization of currency point-of-sale algorithms.

    контрольная работа [1011,9 K], добавлен 14.02.2016

  • Commercial banks as the main segment market economy. Principles and functions of commercial banks. Legal framework of commercial operation banks. The term "banking risks". Analysis of risks and methods of their regulation. Methods of risk management.

    дипломная работа [95,2 K], добавлен 19.01.2014

  • The grey market is an over-the-counter market where dealers may execute orders for preferred customers as well as provide support for a new issue before it is actually issued. Sometimes, "dark markets” are referred to as a third type of grey market.

    презентация [2,1 M], добавлен 18.12.2013

  • Main segments of the financial market: investment, loan, stock, insurance, foreign exchange markets. Top 10 currency traders of overall volume. Internationalization of the national currency. The ratio of US Dollar and Euro against ruble in 2009-2012.

    доклад [115,0 K], добавлен 14.12.2013

  • Financial position of the "BTA Bank", prospects, business strategy, management plans and objectives. Forward-looking statements, risks, uncertainties and other factors that may cause actual results of operations; strategy and business environment.

    презентация [510,7 K], добавлен 17.02.2013

  • History of the online payment systems. Payment service providers. Online bill payments and bank transefrs. Pros and cons for using online payment systems. Card Holder Based On Biometrics. Theft in online payment system. Online banking services, risk.

    реферат [37,2 K], добавлен 26.05.2014

  • History of introduction of a modern banking system to the Muslim countries, features of their development and functioning in today's market economy. Perspectives of future development of Islamic banking in the world and in the Republic of Kazakhstan.

    курсовая работа [1,3 M], добавлен 19.04.2012

  • The history of the development of Internet banking in Kazakhstan and abroad. Analysis of the problems faced by banks in the development of this technology. Description of statistical of its use and the dynamics of change. Security practices for users.

    презентация [1,3 M], добавлен 24.05.2016

  • Theoretical basis of long-term loans: concept, types. Characteristics of the branch of Sberbank of Russia. Terms and conditions of lending to households in Sberbank of Russia. Financing of investment projects. Risk - the main problem in the credit market.

    реферат [28,0 K], добавлен 17.09.2013

Работы в архивах красиво оформлены согласно требованиям ВУЗов и содержат рисунки, диаграммы, формулы и т.д.
PPT, PPTX и PDF-файлы представлены только в архивах.
Рекомендуем скачать работу.