buy and hold strategy

27
Comparison of the Buy and Hold Strategy with Trading System of Technical Rules Enhanced by ANN and GA Case Study: Tehran Stock Exchange By: K.Dehghan Manshadi Sep 2012

Upload: kdmslideshare

Post on 10-Jul-2015

147 views

Category:

Business


0 download

TRANSCRIPT

Page 1: Buy and Hold Strategy

Comparison of the Buy and Hold Strategy

with Trading System of Technical Rules

Enhanced by ANN and GA

Case Study: Tehran Stock Exchange

By:K.Dehghan Manshadi

Sep 2012

Page 2: Buy and Hold Strategy

Table of Contents

• Definitions

• Goals of the research

• Previous Research

• Study steps

• Technical Rules as the trading system parts

• GA structure used

• ELMAN Network

• Testing Hypothesis Approach

• Key Results

2

4

5

8

10

15

18

20

22

Page 3: Buy and Hold Strategy

Some Definitions

Trading System

Technical Analysis

Trading Policy

Using set of tools and techniques in order to make investment decisions

Methods and strategies used to forecast future prices based on different factors e.g. past prices, volume, trends ,..

One turning point is a point in time where one price trend change into another one. In general there are 3 main trends: upward, downward, and uniform trends

Turning Points

The approach that one trader choose in order to do his/her trades to gain from positions he/she gets in the market

2

Page 4: Buy and Hold Strategy

Table of Contents

• Definitions

• Goals of the research

• Previous Research

• Study steps

• Technical Rules as the trading system parts

• GA structure used

• ELMAN Network

• Testing Hypothesis Approach

• Key Results

2

4

5

8

10

15

18

20

22

Page 5: Buy and Hold Strategy

Research Goals

Research OBJ.

• Dependency of Parameter setting to Investors Experience

• Different Signals from different Trading Rule at the same Time

• Difficulty of changing different signals from different rules to one trading decision

Difficulties for using Technical Analysis

Key Issues

Technical Rules are based on parameters that if are set properly, will lead to profitable positions in market. The main challenge regarding technical rules are their different mechanism to produce trading signals. This will result in different signals by different rules at the same time. And this will mixed the traders.

Building Up the new Intelligent Trading System to omit the Dependency of investments to Investors experience

4

Page 6: Buy and Hold Strategy

Table of Contents

• Definitions

• Goals of the research

• Previous Research

• Study steps

• Technical Rules as the trading system parts

• GA structure used

• ELMAN Network

• Testing Hypothesis Approach

• Key Results

2

4

5

8

10

15

18

20

22

Page 7: Buy and Hold Strategy

Studies Categorization

Category one

Studies done to develop scientific

framework for formulating TA

Netcci, Brok,

Murphi, Bollinger,

Achelis, Osle

Category Two

Category Three

Category Four

Stud

ies Catego

ries

Focus of the Research's Top Researchers

Studies done to investigate the

forecasting power of technical rules

compered to other forecasting tools

Studies done to evaluate the statistical

aspects and quality of the rules outputs.

Studies done to optimize the TA

indicators and rules and developing

new trading tools

Fama, Blume, James,

Chang,

Osler,Alexander

Scatchell

Thomson, Williams,

Bollinger

5

Page 8: Buy and Hold Strategy

Previous Research's

Alejandro

Rodríguez

Researcher Year Subejct Key Take Away

Using ANN to enhance the TA indices

ANN had a remarkable effect on TA indices performance

2011

Xiaowei Lin

Using GA to improve the forecasting parameters in TA and enhancing the ESN parameters to reach better forecasted turning point

The system based on GA resulted in more profitability compared with B&H strategy2011

Liu, Chang ,

et.al Building up an efficient forecasting model in order to producing trading signals

CBDWNN had a better performance than other studied models

2009

Baba,Inoue,

& Yanjun

Establish a system composed of ANN and GA to forecast the TOPIX in future market

The composite model had a good performance in forecasting the market Index

2002

Kuo, Chen

and Hwang

Intelligent system to support decision making based on GA and fuzzy ANN

The new system enables quantification of qualitative variables affecting stock price2001

6

Page 9: Buy and Hold Strategy

Table of Contents

• Definitions

• Goals of the research

• Previous Research

• Study steps

• Technical Rules as the trading system parts

• GA structure used

• ELMAN Network

• Testing Hypothesis Approach

• Key Results

2

4

5

8

10

15

18

20

22

Page 10: Buy and Hold Strategy

Study steps and Trading System Architecture

Setting Parameters by GA and Turning Point Diagnoses

Network Build up and

Training

Testing Hypothesis and

Assess the performance

The society and selected Sample

Society: Stocks in Tehran 50 Company IndicesSample: randomly chosen 15 stocksTimeframe: 8 years2005-2012

Suitable training of the GA parameters for each trading rule to forecast the trading signals

Changing different trading signals from different rules to one trading signal with the help of ELMAN network

Calculating the portfolio %return by considering uniform weighting across all assets and running Mann Whitney non-parametric Test

Trad

ing

Syst

em A

rch

.

8

Page 11: Buy and Hold Strategy

Table of Contents

• Definitions

• Goals of the research

• Previous Research

• Study steps

• Technical Rules as the trading system parts

• GA structure used

• ELMAN Network

• Testing Hypothesis Approach

• Key Results

2

4

5

8

10

15

18

20

22

Page 12: Buy and Hold Strategy

Technical Rules – 1 of 4

Golden

Cross

and Dead

Cross

Simple MA is a popular technical indicator which calculates the mean price in a specified period in which MA(N) means long-term MA while MA(n) means short-term MA. Cross section of these two represent a trading point.

Approach FigureParameters

Moving

Average

Envelope

MA envelope forms a channel or zone of commitment around a MA. If price breaks the upper band in downtrend, then it is time to buy; if it breaks through the lower band in uptrend, then it is time to sell

MA(n)

MA(N)

10

Page 13: Buy and Hold Strategy

Technical Rules – 2 of 4

Relative

strength

Index

System

RSI ranges from 0 to 100. Generally, if the RSI rises above overboughtlevel (usually 80), it indicates a selling signal; if it falls belowoversold level (usually 20), it indicates a buying signal.

Approach FigureParameteres

Rate of

change

Index

The divergence of different ROCs can indicate possible reversal of price trend. Generally, when long-term ROC reaches a new high while short-term ROC locates near the equilibrium line (usually with the value of 100), the price will possibly fall down; similarly, when long-term ROC reaches a new low while short-termROC is near the equilibrium line, the price may ascend

11

Page 14: Buy and Hold Strategy

Technical Rules – 3 of 4

Stochastic

System

In the up-trend, it tries to

measure when the closing

price would get close to the

lowest price in the given

period; in the down-trend,

it means when the closing

price would get close to the

highest price in the given

period.

The crossover of %K and %D

lines may indicate meaningful

reversal in price trend.

Approach FigureParameters

• C:close price at now• LL :lowest price in the period• HH :highest price in the priod

12

Page 15: Buy and Hold Strategy

Technical Rules – 4 of 4

Hammer

and

Hanging

man

Indicates price reversal in the future

Approach FigureParameters

Dark

Cloud

Cover

Indicates price reversal in the future

ndC :next day close pricepdO :previous day open price

Piercing

Line

Indicates price reversal in the future

Engulfing

Pattern

Indicates price reversal in the future

13

Page 16: Buy and Hold Strategy

Table of Contents

• Definitions

• Goals of the research

• Previous Research

• Study steps

• Technical Rules as the trading system parts

• GA structure used

• ELMAN Network

• Testing Hypothesis Approach

• Key Results

2

4

5

8

10

15

18

20

22

Page 17: Buy and Hold Strategy

GA Structure – Fitness Function

Genetic Structure- Buy Position

If Ti is a buy position, then there are three states for fitness function:

B) If Sj is a sell signal then we should have punishment for wrong identification

If the Ti is an expected selling position then the fitness function will be build in a similar way.

15

1

2

3

4

5

6

7

8

9

Page 18: Buy and Hold Strategy

GA Steps

GA Structure – Key Steps

Considering following chromosome structure for each feasible solution

Creating a random society as chromosomes with above structure

Calculating the fitness function for each chromosome

In order to generating the next generation, some current chromosomes are selected as parents

F (Position) = 2- sp + 2 *(sp -1) * (pos-1) / (n-1)

With the following equations each pare of parents reproduce new spring:Offspring 1 = Parent 1 * (rand1) + Parent 2 * (1-rand1)Offspring = Parent 1 * (rand ) + Parent 2 * (1-rand )

Next step is to produce new generation. Next generation is composed of the best current springs and new springs.

Parameters and Specifications of the used GA:Population: 50Gen: 300GGAP: 0.8Parent selection approach:Roulette wheel selection

New spring creation approach:Recombination

Mutation probability: 0.1

Policy to create new generation: keeping 10% of the

best current springs+ keeping 10% of the worst

current springs+ the random springs of the old and

new generation

P1 p2 P3 …… Pn

16

1

3

2

5

4

6

7

Page 19: Buy and Hold Strategy

Table of Contents

• Definitions

• Goals of the research

• Previous Research

• Study steps

• Technical Rules as the trading system parts

• GA structure used

• ELMAN Network

• Testing Hypothesis Approach

• Key Results

2

4

5

8

10

15

18

20

22

Page 20: Buy and Hold Strategy

ELMAN Network

Net

wo

rk A

rch

itec

ture

Net

wo

rk S

pe

cifi

cati

on • Recurrent Network with two layer

• The recurrent specification of the network enable detecting time varying

trends – high approximating power

• The main difference of ELMAN with other 2layers networks is to have a

recurrent relationship in layer one – delay in this layer keep the past values

in the network to use them in future.

18

Page 21: Buy and Hold Strategy

Table of Contents

• Definitions

• Goals of the research

• Previous Research

• Study steps

• Technical Rules as the trading system parts

• GA structure used

• ELMAN Network

• Testing Hypothesis Approach

• Key Results

2

4

5

8

10

15

18

20

22

Page 22: Buy and Hold Strategy

Testing Hypothesis Approach

Implications

• To what extend we can rely on historic data?

• How much data is suitable to train the network?

• It’s a rule of thumb that using more data to train the Network don’t result in better performance all the time

• Price time series nonstationary and changing behavior

Challenges with the Network Rolling Window Approach

If the time series behavior trough the time is nonstattionary, it means some characteristics of the series such as noise as well as the forecasting parameters change trough the time . Therefore using a static model lead to weak forecast.

P-Value of the Mackinnon statistic in dickey-Fuller test for most of the stocks is remarkable(very big) and the unit root hypothesis is rejected that admit the nonstationary of the price time series in our sample

20

Page 23: Buy and Hold Strategy

Table of Contents

• Definitions

• Goals of the research

• Previous Research

• Study steps

• Technical Rules as the trading system parts

• GA structure used

• ELMAN Network

• Testing Hypothesis Approach

• Key Results

2

4

5

8

10

15

18

20

22

Page 24: Buy and Hold Strategy

The system performance in diagnosing turning points

0

20

40

60

80

100

120

140

No. of Correct Signals

No. of incorrect Signals

No. of Zero Signals in Windows

Signals %Frequency

Correct Signals 31%

Zero Signals 61%

Wrong Signals 8%

Implication

The developed trading system have a good performance in diagnosing trading points

22

Page 25: Buy and Hold Strategy

Comparison between B&H Strategy and the developed Trading System performance

151%

-10%

24%

48%

77%

49%

17%26% 29%

44%

-20%

0%

20%

40%

60%

80%

100%

120%

140%

160%

window1 window2 window3 window4 window5

%R

ETU

RN

Implication

Both Strategy performance are remarkable. The trading system in all window had positive performance

23

Buy and Hold

Trading System

Page 26: Buy and Hold Strategy

Testing Hypothesis

Implication

Statistically there is no significant difference between the returns in B&H strategy and the intelligent Trading System

No

n-P

aram

etri

c Te

stPa

ram

etri

c Te

st

No significant difference between performance of the two strategy

24

Page 27: Buy and Hold Strategy

ConclusionsSu

gges

tio

ns

for

futu

re

stu

die

sK

ey R

esu

lts

• TA like the buy and hold strategy possess the potential for profitability in Iran Market

• Both Active and Passive Strategies can be profitable in Iran Stock Market• Artificial Intelligence can help improve the performance of technical

Analysis rules• The variance of returns in B&H strategy is more than suggested trading

system• Good performance of the technical analysis can approve the weak

efficiency of the market.

• Comparison of the trading system based on technical rules with other trading strategies such as momentum and reverse.

• In this study the weights of different assets assumed equal. Rebalancing the portfolio trough the time can be good option to enhance the trading system performance.

• Using more technical rules to build the system• Using other artificial intelligence techniques to set the technical parameters• Considering other factors like volume of the trades in trading system to

moderate the sensitivity of the system to price changes.

25