Besting Dollar Cost Averaging Using A Genetic Algorithm Thesis Proposal James Maxlow Christopher...

22
Besting Dollar Cost Besting Dollar Cost Averaging Using A Averaging Using A Genetic Algorithm Genetic Algorithm Thesis Proposal Thesis Proposal James Maxlow James Maxlow Christopher Newport University Christopher Newport University October 2003 October 2003
  • date post

    18-Dec-2015
  • Category

    Documents

  • view

    219
  • download

    2

Transcript of Besting Dollar Cost Averaging Using A Genetic Algorithm Thesis Proposal James Maxlow Christopher...

Besting Dollar Cost Averaging Besting Dollar Cost Averaging Using A Genetic AlgorithmUsing A Genetic Algorithm

Thesis ProposalThesis ProposalJames MaxlowJames Maxlow

Christopher Newport UniversityChristopher Newport UniversityOctober 2003October 2003

IntroductionIntroduction

Wealth creating through investment is an Wealth creating through investment is an important goal for fiscally responsible citizensimportant goal for fiscally responsible citizens

Many investors, though, fear or don’t understand Many investors, though, fear or don’t understand the workings of investment markets, and are the workings of investment markets, and are distrustful of advice given by professionalsdistrustful of advice given by professionals

Because of this, they may choose to rely on a Because of this, they may choose to rely on a purely mechanical investing approach known as purely mechanical investing approach known as dollar-cost-averaging that absolves then from dollar-cost-averaging that absolves then from falling prey to “bad” investment advicefalling prey to “bad” investment advice

However, what if there were a mechanical However, what if there were a mechanical strategy that could outperform DCA?strategy that could outperform DCA?

PurposePurpose

The purpose of this project is to devise The purpose of this project is to devise mechanical investment strategies that mechanical investment strategies that outperform dollar-cost-averagingoutperform dollar-cost-averagingIf this can be accomplished, then such strategies If this can be accomplished, then such strategies can be made available to investors as can be made available to investors as alternatives to DCAalternatives to DCAThese strategies will be based solely on the These strategies will be based solely on the price histories of investments, ignoring any price histories of investments, ignoring any attempts to “time” the marketattempts to “time” the marketThe devising of strategies will be left to the The devising of strategies will be left to the workings of a genetic algorithmworkings of a genetic algorithm

QuestionsQuestionsSome questions that this project will seek to answer Some questions that this project will seek to answer are as followsare as followsDoes applying the derived strategies to test data Does applying the derived strategies to test data sets lead to greater portfolio values than dollar-cost sets lead to greater portfolio values than dollar-cost averaging over the same data?averaging over the same data?How does the underlying trend of the training data How does the underlying trend of the training data set used to derive a strategy affect the strategy’s set used to derive a strategy affect the strategy’s performance on the test data set? performance on the test data set? Will strategies derived using the same training data Will strategies derived using the same training data share common actions at most or all price changes, share common actions at most or all price changes, or will significant differences show up, producing or will significant differences show up, producing multiple distinct but equally effective strategies?multiple distinct but equally effective strategies?

QuestionsQuestions

If multiple different strategies can be produced using If multiple different strategies can be produced using a single training data set, what can be said about a single training data set, what can be said about the probability of any single strategy producing the probability of any single strategy producing positive results when used on a test data set?positive results when used on a test data set?Will hold be an action suggested by the derived Will hold be an action suggested by the derived strategies due to the transactional cost of buying strategies due to the transactional cost of buying and selling, or will the genetic algorithm route and selling, or will the genetic algorithm route around the hold action by finding more productive around the hold action by finding more productive buy and sell actions in its exploration of buy and sell actions in its exploration of possibilities?possibilities?Will transactional costs play a significant role in the Will transactional costs play a significant role in the quality of the output produced by derived strategies quality of the output produced by derived strategies and dollar-cost strategies on a given data set?and dollar-cost strategies on a given data set?

Research - DCAResearch - DCA

The use of DCA allows for the acquisition of The use of DCA allows for the acquisition of shares at a shares at a lower average costlower average cost than the than the average average share priceshare price

Because DCA is an automatic-buy strategy, there Because DCA is an automatic-buy strategy, there are no decisions to be made by the investor, save are no decisions to be made by the investor, save for the investment itself – it is a hands-off strategyfor the investment itself – it is a hands-off strategy

This makes it appealing to those that feel they This makes it appealing to those that feel they have no ability to know when to buy or sellhave no ability to know when to buy or sell

It is often used by those on fixed incomes and in It is often used by those on fixed incomes and in retirement plans (401k, et. al.)retirement plans (401k, et. al.)

But does it actually provide good ROI?But does it actually provide good ROI?

Research - DCAResearch - DCA

Some research Some research [5][5] suggests that the use of DCA suggests that the use of DCA yields no significantly better ROI than random yields no significantly better ROI than random buy/sell decisions for a given investmentbuy/sell decisions for a given investment

If this is true, then the psychological security that If this is true, then the psychological security that DCA provides hesitant investors may simply DCA provides hesitant investors may simply hide its relative ineffectivenesshide its relative ineffectiveness

A strategy that bests DCA’s ROI for a given A strategy that bests DCA’s ROI for a given investment, then, would serve as a more investment, then, would serve as a more productive alternative to random, “time the productive alternative to random, “time the market” buy/sell decisionsmarket” buy/sell decisions

Background – Genetic AlgorithmsBackground – Genetic Algorithms

The majority of today’s GA research expands on the The majority of today’s GA research expands on the pioneering work done by John Holland in the 60spioneering work done by John Holland in the 60s

GAs work by evolving solutions to problemsGAs work by evolving solutions to problems

More specifically, possible solutions are split, More specifically, possible solutions are split, recombined and mutated to breed new solutions that recombined and mutated to breed new solutions that are “more fit” or stronger than their predecessorsare “more fit” or stronger than their predecessors

As the generations of solutions pass by, the meta-As the generations of solutions pass by, the meta-search for the best or ideal solution is focused on search for the best or ideal solution is focused on promising lineages – most weaker branches are promising lineages – most weaker branches are eventually abandonedeventually abandoned

Background – Genetic AlgorithmsBackground – Genetic Algorithms

Because of this, the initial time of the GA is spent Because of this, the initial time of the GA is spent weeding out totally unfit solutions, and the latter time weeding out totally unfit solutions, and the latter time is spent optimizing very fit solutionsis spent optimizing very fit solutions

This process can, in many cases, yield greater This process can, in many cases, yield greater efficiency in finding an ideal solution than brute-force efficiency in finding an ideal solution than brute-force search techniquessearch techniques

Moreover, a GA only needs to know what a solution Moreover, a GA only needs to know what a solution will look like – it does not need to have a collection will look like – it does not need to have a collection of all possible solutions like a brute-force technique of all possible solutions like a brute-force technique – because it can “create” solutions on its own– because it can “create” solutions on its own

Background – Genetic AlgorithmsBackground – Genetic Algorithms

All of these factors make Gas highly appealing for ill-All of these factors make Gas highly appealing for ill-defined problems that feature odd or unknown defined problems that feature odd or unknown solution spacessolution spaces

Three tasks must be completed to run a GAThree tasks must be completed to run a GA

First, the structure of the possible solution First, the structure of the possible solution (chromosome) must be designed(chromosome) must be designed

Second, the fitness algorithm for evaluating the Second, the fitness algorithm for evaluating the strength of possible solutions must be designedstrength of possible solutions must be designed

Third, solution population, mating, and mutation Third, solution population, mating, and mutation variables must be setvariables must be set

Research – EO and GAlibResearch – EO and GAlib

EOEO GALibGALib

Better tutorialsBetter tutorials Better documentationBetter documentation

Better multi-platform supportBetter multi-platform support Less space requiredLess space required

Parallel processing versionParallel processing version Parallel processing versionParallel processing version

Wide range of parameter Wide range of parameter setting optionssetting options

Wide range of parameter Wide range of parameter setting optionssetting options

Currently being worked onCurrently being worked on Not updated since 2000Not updated since 2000

Powerful customizationPowerful customization Powerful customizationPowerful customization

Genetic Algorithm DesignGenetic Algorithm Design

The chromosome for this project will consist of an The chromosome for this project will consist of an array of integer values between 0 and 2 inclusivearray of integer values between 0 and 2 inclusive

The The valuevalue will correspond to a buy, sell, or hold will correspond to a buy, sell, or hold decisiondecision

The The positionposition of the value in the array will correspond of the value in the array will correspond to an interval representing a given percentage to an interval representing a given percentage increase or decrease in stock priceincrease or decrease in stock price

0 1 1 2 0 0 1 2 2[-20%

, -15%

)

[-15%, -

10%)

[-10%, -

5%)

[-5%,

0%)

[0%,

5%)

[5%,

10%)

[10%,

15%)

[15%,

20%)

[25%,

30%)

… …

Genetic Algorithm DesignGenetic Algorithm Design

Any possible solution will offer direct advice as to what Any possible solution will offer direct advice as to what action to take when a given stock changes in priceaction to take when a given stock changes in price

But how can the fitness of this advice be judged?But how can the fitness of this advice be judged?

The GA will apply the advice of every possible solution The GA will apply the advice of every possible solution it generates to the established price history of a stock it generates to the established price history of a stock – the higher the ROI for that advice, the stronger the – the higher the ROI for that advice, the stronger the solutionsolution

0 1 1 2 0 0 1 2 2

[-20%, -

15%)

[-15%, -

10%)

[-10%, -

5%)

[-5%,

0%)

[0%,

5%)

[5%,

10%)

[10%,

15%)

[15%,

20%)

[25%,

30%)

… …

Genetic Algorithm DesignGenetic Algorithm Design

At this point it can be seen that the GA will try to form advice At this point it can be seen that the GA will try to form advice based on past stock prices – but that in itself does nothing for the based on past stock prices – but that in itself does nothing for the investorinvestor

It is hoped that there is a hidden structure to stock price It is hoped that there is a hidden structure to stock price fluctuations such that “what worked well in the past will likely fluctuations such that “what worked well in the past will likely work well again in the future”work well again in the future”

That is to say that if buying when a stock’s price rose 12% in the That is to say that if buying when a stock’s price rose 12% in the past produced positive results, so should repeating that action in past produced positive results, so should repeating that action in the future, in most casesthe future, in most cases

Genetic Algorithm DesignGenetic Algorithm Design

The next phase, then, will be to apply the strongest solutions to a The next phase, then, will be to apply the strongest solutions to a newnew data set – the “current” stock price values over, say, a year – and see data set – the “current” stock price values over, say, a year – and see how the solution’s ROI compares with DCA over the same time periodhow the solution’s ROI compares with DCA over the same time period

If the solution’s ROI is higher, then it will have been established that If the solution’s ROI is higher, then it will have been established that GA generated advice based solely on price histories can be a better GA generated advice based solely on price histories can be a better alternative to DCAalternative to DCA

If, however, applying the solutions to new data sets fails to produce If, however, applying the solutions to new data sets fails to produce significantly better results than DCA, then it will have been established significantly better results than DCA, then it will have been established that price histories alone are insufficient to base decisions onthat price histories alone are insufficient to base decisions on

MethodologyMethodology

GA code will be chosen (EO or GAlib)GA code will be chosen (EO or GAlib)

Stocks will be chosen and price histories Stocks will be chosen and price histories acquired (given trend lines, deviation from the acquired (given trend lines, deviation from the trend, and distance back in time)trend, and distance back in time)

Chromosome will be implemented in codeChromosome will be implemented in code

Fitness algorithm will be implemented in codeFitness algorithm will be implemented in code

Program structure will be finalizedProgram structure will be finalized

Testing will be done with various GA parametersTesting will be done with various GA parameters

MethodologyMethodology

The GA will be set to work devising The GA will be set to work devising severalseveral strategies from the price history of a given stock strategies from the price history of a given stock

Each of these strategies will then be applied to Each of these strategies will then be applied to the test data set to determine ROIthe test data set to determine ROI

This will be repeated for all stocksThis will be repeated for all stocks

DCA’s ROI for each stock will be calculated on DCA’s ROI for each stock will be calculated on the test data setthe test data set

Optimum ROI for each stock (if “timed” perfectly) Optimum ROI for each stock (if “timed” perfectly) will be calculated for comparative resultswill be calculated for comparative results

MethodologyMethodology

The results of the devised strategies will be The results of the devised strategies will be statistically analyzed to determine if they indeed statistically analyzed to determine if they indeed offer any benefit over DCA, and if the GA can offer any benefit over DCA, and if the GA can devise devise consistentlyconsistently better strategies better strategies

The final report will be writtenThe final report will be written

TimelineTimeline

Evaluation of GAlib / EO for project suitability - 3 Evaluation of GAlib / EO for project suitability - 3 daysdays

Stock and index choices, gathering of price histories, Stock and index choices, gathering of price histories, calculation of optimal cases - 2 dayscalculation of optimal cases - 2 days

Design and implementation of chromosome and Design and implementation of chromosome and fitness model - 1.5 weeksfitness model - 1.5 weeks

Testing, tweaking, and refactoring code; testing with Testing, tweaking, and refactoring code; testing with parameter variation - 2 daysparameter variation - 2 days

TimelineTimeline

Using genetic algorithm to derive strategies, applying Using genetic algorithm to derive strategies, applying strategies to new data sets - 3 daysstrategies to new data sets - 3 days

Dollar-cost averaging program coding and use on Dollar-cost averaging program coding and use on data sets - 1 daydata sets - 1 day

Statistical Analysis - 2 weeksStatistical Analysis - 2 weeks

Report - 3 weeksReport - 3 weeks

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

Total - 8 weeksTotal - 8 weeks

ConclusionConclusion

The efficiency and robustness of genetic The efficiency and robustness of genetic algorithms should allow for the easy algorithms should allow for the easy derivation of mechanical investment derivation of mechanical investment strategiesstrategies

These strategies can be put head to head These strategies can be put head to head with DCA to determine their value to with DCA to determine their value to investorsinvestors

It is believed that DCA It is believed that DCA cancan be bested be bested using this methodusing this method

ReferencesReferences[1] EO documentation: [1] EO documentation: https://sourceforge.net/projects/eodev/https://sourceforge.net/projects/eodev/

[2] Edleson, M. E. Value [2] Edleson, M. E. Value Averaging: The Safe and Easy Investment Averaging: The Safe and Easy Investment StrategyStrategy. Chicago: International Publishing Corporation, 1991.. Chicago: International Publishing Corporation, 1991.

[3] GAlib documentation: [3] GAlib documentation: http://lancet.mit.edu/ga/http://lancet.mit.edu/ga/

[4] Liscio, J. [4] Liscio, J. Portfolio Discipline: The Rewards of Dollar Cost AveragingPortfolio Discipline: The Rewards of Dollar Cost Averaging. . Barron’sBarron’s, Aug. 8, 1988, pp. 57-58., Aug. 8, 1988, pp. 57-58.

[5] Marshall, Paul S. [5] Marshall, Paul S. A Statistical Comparison of Value Averaging vs. A Statistical Comparison of Value Averaging vs. Dollar Cost Averaging and Random Investing TechniquesDollar Cost Averaging and Random Investing Techniques. Journal of . Journal of Financial and Strategic Decisions: Vol. 13 No. 1, Spring 2000.Financial and Strategic Decisions: Vol. 13 No. 1, Spring 2000.

[6] Mitchell, Melanie. [6] Mitchell, Melanie. An Introduction to Genetic AlgorithmsAn Introduction to Genetic Algorithms. Cambridge: . Cambridge: The MIT Press, 2002.The MIT Press, 2002.

[7] The Vanguard Group of Investment Companies. [7] The Vanguard Group of Investment Companies. The Dollar Cost The Dollar Cost Averaging AdvantageAveraging Advantage. Valley Forge: Brochure #0888-5, BDCA, 1988.. Valley Forge: Brochure #0888-5, BDCA, 1988.