28
Genetic Algorithms and Investment Strategy Development Michael Dworkis, Darien Huang Faculty Mentor: Dr. Franklin Allen May 12, 2008 Wharton Research Scholars The Wharton School, University of Pennsylvania Abstract: The aim of this paper is to investigate the use of genetic algorithms in investment strategy development. This work follows and supports Franklin Allen and Risto Karljalainen’s previous work 1 in the field, as well adding new insight into further applications of the methodology. The paper first examines the capabilities of the algorithm designed in Allen and Karjalainen’s work by using humandeveloped (rather than markethistorical) datasets to determine whether the algorithm can detect simple signals; the results show that the algorithm is quite capable of such basic tasks. Next, the S&P 500 test performed in Allen and Karjalainen’s original work was confirmed. Then, experiments were conducted in emerging equity markets, as well as commodities markets with a range of fundamental as well as technical indicators. The results generally show no significant positive excess returns above a buyandhold strategy; speculations for possible reasons are discussed. In addition, suggestions for future research endeavors are presented. We would like to thank Dr. Franklin Allen and Dr. Risto Karjalainen for their immense help and guidance throughout our research process. We thank Dr. Martin Asher and the Wharton Research Scholars program for helping to make this research possible. All the views expressed in this paper are solely attributed to the authors and do not in any way represent any authors cited or any employers of the authors.

Genetic Algorithms and Investment Strategy Development

Embed Size (px)

DESCRIPTION

Genetic Algorithms and Investment Strategy Development Genetic Algorithms and Investment Strategy Development Genetic Algorithms and Investment Strategy Development Genetic Algorithms and Investment Strategy Development Genetic Algorithms and Investment Strategy Development Genetic Algorithms and Investment Strategy Development Genetic Algorithms and Investment Strategy Development

Citation preview

  • GeneticAlgorithmsandInvestmentStrategyDevelopment

    MichaelDworkis,DarienHuang

    FacultyMentor:Dr.FranklinAllen

    May12,2008

    WhartonResearchScholars

    TheWhartonSchool,UniversityofPennsylvania

    Abstract:Theaimof thispaper is to investigate theuseofgeneticalgorithms in investment strategydevelopment.Thiswork followsandsupportsFranklinAllenandRistoKarljalainenspreviouswork1 inthe field, aswell adding new insight into further applications of themethodology. The paper firstexamines the capabilitiesof thealgorithmdesigned inAllenandKarjalainensworkbyusinghumandeveloped (rather than markethistorical) datasets to determine whether the algorithm can detectsimplesignals; theresultsshow that thealgorithm isquitecapableofsuchbasic tasks.Next, theS&P500 test performed inAllen and Karjalainens originalworkwas confirmed. Then, experimentswereconductedinemergingequitymarkets,aswellascommoditiesmarketswitharangeoffundamentalaswellas technical indicators. The resultsgenerallyshownosignificantpositiveexcess returnsaboveabuyandhold strategy; speculations for possible reasons are discussed. In addition, suggestions forfutureresearchendeavorsarepresented.WewouldliketothankDr.FranklinAllenandDr.RistoKarjalainenfortheirimmensehelpandguidancethroughoutourresearchprocess.WethankDr.MartinAsherandtheWhartonResearchScholarsprogramforhelpingtomakethisresearchpossible.Alltheviewsexpressedinthispaperaresolelyattributedtotheauthorsanddonotinanywayrepresentanyauthorscitedoranyemployersoftheauthors.

  • Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,2

    OutlineI. Motivation&IntroductiontoGA (p.3)

    ExperimentMotivation Investmentanalysisprocess Limitationsintraditionalinvestmentstrategydevelopmentprocess IntroductiontoGeneticAlgorithmsandimplementationininvestmentstrategydevelopment PotentialstrengthsandweaknessesofGeneticAlgorithmsforinvestmentstrategydevelopment Investing:ArtorScience? Programminglanguagechoice Previousworkongeneticalgorithmuseinfinance

    II. Perfectforesightexperiment (9)

    ExperimentMotivation Inputselection Implementation Results&Discussion

    III. S&P500experiment (13)

    ExperimentMotivation Inputselection Implementation Results&Discussion

    IV. EmergingMarketsExperiment:ChinaASharesMarket (15)

    ExperimentMotivation Inputselection Implementation Results&Discussion

    V. GasolinePredictionExperiment (19)

    ExperimentMotivation Inputselection Implementation Results&Discussion

    VI. Conclusions (24)

    Experimentresultdiscussion SuggestedFutureExperimentsandSpeculations

  • Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,3

    I. Motivation&IntroductiontoGeneticAlgorithms

    ExperimentMotivation:Marketparticipantsareconstantlysearchingfornew investmentstrategiesto

    earnexcessreturns (definedasreturnsaboveabenchmarkmeasure) infinancialmarkets. Investment

    strategies can be based onmodels as simple as buying stockswith low price/earnings ratios, or as

    complex as trading a levered derivatives portfolio based on the historical correlations between a

    portfoliooffixedincomesecurities,whiledynamicallyhedging.Strategiesproventoyieldexcessreturns

    can be exploited in the market to earn money. The development of new successful investment

    strategies,orthe improvementofmethodologiestoproducenewsuccessful investmentstrategiescan

    beaprofitablebusinessventure.

    Howare investment strategiesdeveloped?The answer can vary across asset classes. In the caseof

    stocks and corporate bonds, traditional fundamental analysis entails analyzing the corporation, the

    quality of the assets, and the specifics of the securities issued2. Such analysis is usually carried out

    through the study of traditional quantitative indicators emphasizing value (various price/earnings

    metrics), financial stability (liquidity ratios), andqualitativeopinions such asmanagementdepth and

    expertiseandmarketdominance.Thegoalof suchanalysis is todeterminewhat is the real, intrinsic

    valueofasecurity,andtothencomparethatvaluetothepricebeingofferedinthemarket.Traditional

    analysis tools includediscountedcash flowmodeling,multiplesanalysis,andcomparable transactions

    analysis.Whenadiscrepancybetweenthe intrinsicvalueandmarketpriceexists,there isachanceto

    profitbybuyingsecuritiesbelievedtobeundervaluedandsellingsecuritiesbelievedtobeovervalued.

    Other typesof analysis tools include technical analysis, inwhich an analyst studies variables such as

    currentprice,historicalprice,volume,andmoretopredictfutureprices,andinvestsaccordingly.

    Investment strategiescanbebasedonqualitative factors such investing ingreencompanieswitha

    superior focusoncorporatesocial relationsandalternativeenergy,oronquantitative factorssuchas

    trading futuresbasedonabelief that the relationshipbetween theS&P500and the JapaneseNikkei

    index is meanreverting over a 6month horizon. Often investment strategies are based on both

    qualitative and quantitative factors, specializing in a specific market niche (e.g. Asian smallcap

    1Allen,Franklin,RistoKarjalainen."Usinggeneticalgorithmstofindtechnicaltradingrules."JournalofFinancialEconomics51(1999):245271.

    2Whitman,MartinJ.,andMartinShubik.TheAggressiveConservativeInvestor.Wiley,1979.

  • Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,4

    industrial) and then analyzing specific securities based on both quantitative financial and qualitative

    managerialvariables.

    New investmentstrategiesaregenerallydevelopedbyacombinationof innovativehypothesizingand

    empirical research. Generally a human uses various financial analysis tools to discover a repeated

    discrepancybetween intrinsicvalueandmarketprice,and then formulatesan investmentstrategy to

    takeadvantageofthisperceiveddiscrepancy.Thesearchfornewinvestmentstrategiesiscarriedoutby

    thousands of finance professionals around the world, and has the potential to yield huge profits if

    found. For this reason, it isworth thinking not just about individual potential strategies, but about

    refiningtheprocessthroughwhichnewstrategiesaredeveloped.

    Limitations intraditional investmentstrategydevelopmentprocess:Twoprimarybottlenecksexist in

    theprocessofhumansdevelopingnew investment strategies.Firstly,human thoughtprocessesmust

    choosewhatvariablesaresignificantandworthspending time toanalyze.Thisprocesscanbebiased

    bothbytraditionalinvestingphilosophy(e.g.thatlowP/Eratiosoftenpresentabettervaluethanhigh

    P/E ratios) and by the lack of human conceptualization of potential relationships among variables.

    Secondly,thereexistsabottleneck inhumanabilitytoprocessandanalyze largedatasets.Ananalyst

    mightbe interested inpotentially investing inthousandsofpublicly listedcompanies,butwouldnever

    havetimetothoroughlyanalyzealloftheirpublicstatements.

    Inanattempttoalleviatebothofthesepotentialbottlenecks,thispaperexplorestheuseofagenetic

    algorithm to optimize the analysis process in the development of investment strategies. Genetic

    algorithmswere first recognized as a promising tool for financial researchbecauseof theirprevious

    successinsolvingvariousNPhardandcomplexproblemsinengineering.

    IntroductiontoGeneticAlgorithmsandimplementationininvestmentstrategydevelopment:Genetic

    algorithmsareatypeofevolutionaryalgorithm,whichreferstoagroupofsearchheuristicsinspiredby

    evolutionaryprocesses found inbiology.Theseevolutionarysearchheuristicsattempt to findoptimal

    solutionstoproblemsbycreatingsolutionpopulationswhicharethenevolvedovertimeaccordingto

    fitnesscriteriapertainingtothespecificproblem.

    Thegeneticalgorithmused in thispaper is implemented in theMathematicaenvironment,using the

    model developed in the original Allen and Karjalainen paper. Specifically, solution candidates are

    representedinMathematicaasnestedtreefunctions,whichreturnasignaltobuyorsell.Inthecontext

  • ofthefollowingexperiments,allofthesolutioncandidatesreturnBooleanfunctions,becausethesignal

    iseithertobuyornottobuy.However,othertemplatescouldbestructuredtoallowforbuying,short

    selling,orneutralpositions,ortradingmultipleassetswithinastrategy.Eachnodeinthesolutiontree

    canbeafunction,variable,orvalue.Solutioncandidatesareinitiallyrandomlygeneratedaccordingtoa

    predefined template, which contains the available potential functions and variables. Values are

    generated through a randomizing function. Basic functions included in all experiments with the

    algorithm include arithmetic operators, absolute difference, and a moving average function. More

    functionscanandshouldbedevelopedtosuitindividualmodels.

    Sampletradingrule.(Inputs:Price.S&P500close,3monthgasolinefuturescontract)

    Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,5

  • Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,6

    First,apopulationofindividualsolutioncandidatesisgeneratedaccordingtothesolutiontemplate,and

    is then evaluated by the fitness function. In the case of investment strategies, the fitness function

    measuresexcess returnaboveabuyandhold strategy.The individualsare then rankedaccording to

    their fitness, and then randomlymutated and recombinedwith each other (similar to the biological

    processwithrecombinationandmutationofDNAduringthereproductionprocess),withabiastowards

    themostfitindividualspassingontheirtraits.Next,thebestrulefromeachgenerationistestedagainst

    arangeofdatacalledtheselectionperiod. Iftheruleappliedtotheselectionperiodoutperformsthe

    previousrulesappliedtotheselectionperiod,itisthensavedasthebestruledevelopedsofar.Thebest

    ruleisthenappliedtotheoutsampletestperiod,anditsfitnessisagainevaluated.

    Thisprocessofevaluatingthefitnessofthecurrentgenerationandthencreatinganewgenerationof

    solutioncandidatesbasedonthetraitsoftheparentgeneration isthencontinueduntilatermination

    criterion is reached.Generally inexperimentswith investmentstrategydevelopment, the termination

    criteria includereachingamaximumnumberofgenerations,orreachingaplateauoffitnesswhereno

    progressisbeingmadeacrosssubsequentgenerations.

    Potential strengths and weaknesses of Genetic Algorithms for investment strategy development:

    Genetic algorithms help address the two aforementioned bottlenecks in the investment strategy

    development process, but also come with their own limitations. Firstly, there is still an element of

    humanchoicewithrespect toevenhypothesizingwhichvariablesshouldbepassedon to thegenetic

    algorithmbasedprocess.Ifahumancannotconceiveoforfindaquantifiablevariabletoanalyze,there

    isnowayforittobefedintothegeneticalgorithmbasedmodel.Withmanymodelingtechniques,the

    traditional adage of junk in, junk out applies, implying that the results of amodel can only be as

    quality as the data fed into it.With genetic algorithms, because of their unique ability to evolve a

    solutiontoaproblem,junkin,junkoutisnotentirelythecase.Evenifjustsomeoftheinputdatais

    relevanttotheproblemathand,thegeneticalgorithmshouldbeabletofilterouttheuselessdatafrom

    thatwithsomedegreeofpredictivemerit,anddevelopaninvestmentstrategybasedsolelyonthedata

    withpredictivemerit,essentiallyignoringthejunkdata,findingonlythediamondintherough.

    The human bottleneck of choosing where to spend time searching for potentially profitable

    relationshipscanbegreatlyaidedwithageneticalgorithm.Becauseof itssheercomputationalpower

    advantageoverahuman, itcan lookatvastlymorepotentialrelationships thanahumanwouldhave

    timetoanalyze,andthecostofdoingsoisminimalintermsofcomputationalpowerandmemory.

  • Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,7

    Further,geneticalgorithmsapproachproblemswithoutpreviouslyexistingbiases.Ageneticalgorithm

    wouldbejustaslikelytoinitiallyconsiderstrategiesinvestinginequitieswithhighprice/bookvaluesas

    thosewith lowprice/bookvalues,asthealgorithm isuninhibitedbyconventionalwisdom. Thiscan

    add significant valuewhen searching fornew relationships todevelop investment strategies yielding

    aboveaveragereturns.

    Investing:ArtorScience?Bysolelyrelyingonanyquantitative,blackbox investmentmethodology,

    one ismaking tosomedegreeanassumption that investing isaquantifiablescience.Some investors,

    including legends like Warren Buffet3 would likely argue that investing is more of an art, in which

    financial statement analysis, innovative thinking and gut feeling are the primary components in

    success,ratherthanascience,inwhichcompanies,securities,andmarketscanbequantified,analyzed,

    and successfully predicted. With respect to a genetic algorithmgenerated investment strategy, one

    mustanalyzewhetherthestrategymakesanyeconomicorintuitivesense,orifitisjustasemirandom

    combinationofvariablesthatperfectlypredictedthepast,butoffer limited insight intopredictingthe

    futureofthemarkets.However,theredoesnothavetobecompletedisconnectbetweentheartand

    scienceapproachestoinvesting.Algorithmbasedmodelscanbeusedasscreens,toweedoutpotential

    investmentopportunitieswhichmightyieldanaboveaverageexpectedprofit ifanalyzedusingsound

    fundamentalanalysistechniques.

    Programming language choice: The genetic algorithm was implemented in Mathematica, using the

    model developed in 1999 by Franklin Allen and Risto Karjalainen. Mathematica is a popular

    mathematicalsymbolicmanipulationsoftwarewhichiscommonlyusedinscience,engineering,aswell

    as in finance;however, itsuse in finance ismainly limited toacademic research. Practitioners in the

    financial industry (with a strong computing background) generally prefer other packages (such as

    MATLAB) and programming languages (such as C++), because of their computational efficiency.

    Mathematicaiscomparativelyslowtorun,andalsohasasteeperlearningcurvethanothercomparable

    packages. However, it isworthmentioning that especially for finance professionalswhomay not

    necessarily have the background in computer science Mathematica is much easier to grasp than

    programminginC++.ForsomeonewithpriorexposuretomodernprogramminglanguagessuchasJava

    andPython,MATLABprogrammingisrelativelyeasytopickup;Mathematica,however,generallytakes

    3WarrenBuffett,multipleletterstoBerkshireHathawayshareholdersandvariousinterviews.

  • Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,8

    longertomaster.Forcomputationalspeed,directlyprogramminginC++asopposedtousingasoftware

    packageisgenerallythemethodofchoice.

    Forthispaper,Mathematicawasusedbecauseitwasusedtobuildtheoriginalgeneticalgorithmmodel

    inAllen,Karjalainen.Due to the long calculation times, thismethod isnot feasible for tradingonan

    intradaylevel(tickbytick,withineachtradingday),sincesomeofthecalculationstakeseveraldaysof

    computingtime.Thisproblem isexacerbatedwhenmany indicatorvariablesareconsidered). Genetic

    algorithmsdefinitelymayhaveuse in intradaytrading,and futureapplicationscouldconsiderwriting

    suchprogramsinC++forcomputationalspeed.Whileithasitsflaws,Mathematicaisstillawidelyused

    softwarepackagewithverydetaileduserdocumentationandalargecommunityofusers.

    Previousworkongeneticalgorithms in finance:Allen&Karlajainens1999workandensuingnotyet

    publishedwork is thebasis for thispaperandseveralof itsexperiments.The1999paper found that:

    Aftertransactioncosts,therules[foundbythegeneticalgorithm]donotearnconsistentexcessreturns

    overasimplebuyandholdstrategy intheoutofsampletestperiods.Thepaperwentontosuggest

    several topics for future research, including applying the genetic algorithm to futures markets, and

    expandinginputstothemodeltoincludefundamentalvariables.

    FernnndezRodriguez,GonzlezMartel,andSosvillaRivero(2005)4foundthatusinggeneticalgorithms

    tooptimizemovingaveragetradingrules,excessprofitsaboveabuyandholdstrategywereachieved

    fortheGeneralIndexoftheMadridStockMarket.

    Several papers have been published examining the potential for genetic algorithms to add value in

    project finance applications. In particular, constrained optimization models solved using genetic

    algorithms have yielded beneficial results in building portfolio management5 maintenance and

    4FernnndezRodriguez,Fernando,ChristianGonzlezMartel,SimnSosvillaRivero."Optimizationoftechnicalrulesbygeneticalgorithms:evidencefromtheMadridStockMarket."AppliedFinancialEconomics15(2005):773775.

    5Tong,TamandChan.GeneticAlgorithmOptimizationinBuildingPortfolioManagement.ConstructionManagementandEconomics19,(2001):601609.

  • Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,9

    replacement planning, semiconductor capital expenditure budgeting6, and public infrastructure

    investment7.

    In addition to published research, it is believed that numerous hedge funds and private investment

    vehiclesareusinggeneticalgorithms,neuralnetworks,andothermethodsofevolutionarycomputation

    as parts of their quantitative trading strategies. Algorithmic trading by hedge funds and investment

    banksnowaccountsforasignificantamountofmarketvolume.

    I. PerfectForesightExperiment;AbilitiesofGeneticAlgorithm

    ExperimentMotivation:Tostartoffdemonstratingwhatthegeneticalgorithmiscapableof,practice

    datawasused.Thismeansthatthedatahasbeenmanipulatedwithcertainprofitabletrendstosee

    if the algorithm can identify the trends and formulate profitable trading strategies under these

    environments. Theexperiment iscalledPerfectForesight thealgorithm isgiven theability tosee

    onedayaheadby includingasecondvariablecalledtmr(fortomorrow)which istheclosingpriceof

    thenextday. If thisexperiment fails, themodelmustbeadjustedbeforegoing forwardwithother,

    moresophisticatedexperiments.Resultsindicatethatthealgorithmperformsquitewell.

    InputSelection&Data:2variableswerechoseninadditiontoageneric(nonvarying)interestrateset

    arbitrarilylowandconstantfortheentiredurationofthedata.Whileitmayseemextraneoustoexplain

    the variables (they are indeed, quite simple in this basic experiment), the paper will adopt this

    conventionofexplaining thesetupofeachexperiment forall themoresophisticatedexperiments to

    follow.

    1. Price:1monthgasoline futurespricesareusedasa realisticproxy,althoughany liquidasset

    couldhavebeenused.

    2. TomorrowsPrice:This is thepriceat thecloseof thenextday,given to thealgorithm today.

    Theobjectiveisforthealgorithmtolearnthattomorrowspriceisaprofitableindicator.

    6Wang,K.J.,S.HLin."CapacityExpansionandAllocationforaSemiconductorTestingFacilityunderConstrainedBudget."ProductionPlanning&Control13(2002):429437.

    7Hsieh,Tingya,HsinLungYu."GeneticAlgorithmforOptimizationofInfrastructureInvestmentUnderTimeResourceConstraints."ComputerAidedCivilandInfrastructureEngineering19(2004):203212.

  • Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,10

    3. Rate:This is aproxy interest rate, to calculate returns to stayingoutof stockmarket (and

    being in cashmarket). While this is not necessary here, this is used because the algorithm

    expectstotake incashrates,soforsimplicitya1%constant interestratevalue isused. Note

    that thisdoesnotmean rate is in the setofconsiderationvariables,so thereneeds tobeno

    worryabout caseswhere the stock tomorrow closes less than1%higher than todaybut still

    higher.

    Implementation:Forthisexperiment,apopulationsizeof100wasusedfor10generations. Thiswas

    chosenbecauseofcomputationalefficiency,and itwouldbemore interesting ifthegeneticalgorithm

    could find the signalmorequickly. Fitness isdefinedas cumulativeexcess returnoverbuyandhold

    strategy. Transactioncostsweresetto0% (sinceactualperformance isnotwhat isofconcernhere).

    Thetrainingperiodwas5yearsandtheoutsamplewasrunforapproximately10years.

    Results&Discussion:Recallfromtheearlierdiscussionthatonedrawbackofthealgorithmisthatitis

    notpossible to shortsell securitiesdirectly in thealgorithm (although this isaddressed somewhat,

    through a manual trick using spreadsheet programming; this technique is reserved for more

    sophisticatedexperiments). Therefore,given this feature, themostprofitable tradingstrategyshould

    bethesimplesignal:

    tmr>Price //Long stock if tomorrows closing price greater than todays, hold cash

    otherwise.

    Anyothersignalcapturesnoiseandwillnotbeasprofitableasthis. Usingpopulationsize100,for10

    generations,thealgorithmfinds:

    Bestsolutioncandidate:

    Price > tmr //Long stock if tomorrows price > todays price. Most trials found this to be the best

    solutioncandidate;thosethatdidnotfoundverysimilarstrategies.Givenlargertrialsizes(500/50,for

    example),itislikelythatallbestsolutionswillhavethisform.

  • This signalwill recommend a longposition if tomorrows stockprice is greater than todays. This is

    exactlywhatthealgorithmshouldhavefound!Thiswasfoundintherelativelysmallexperimentsizeof

    100/10,withgreatspeed (computing timewas23seconds). While thisseemsquiteobvious (anyone

    wouldknowtobuystocksthataresuretoincreaseinpricethenextday),theabilityoftheprogramto

    finditisaminimumnecessaryconditiontoshowthatalgorithmmightpotentiallybecapableoffinding

    excessreturnsinrealmarketenvironments.

    0%

    100%

    200%

    300%

    400%

    500%

    600%

    700%

    800%

    900%

    1000%

    GasolineBuy&Hold GAStrategy

    Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,11

  • Thisstrategyisquitesuccessfulingeneratingexcessreturnsaswouldbeexpected.Theexcessreturns

    here represent the maximum possible excess returns over the time period in consideration, in the

    absenceofshortselling.Onceagain,thisresultonlydemonstratesthatthegeneticalgorithmisableto

    quickly pick up simple patterns and there is potential for it to find excess returns in real market

    conditions.

    Note:(Thedatesare justusedasplaceholders,sincethetemplatefromanotherexperiment isused) This isthe

    outsampleexcessreturnsforarepresentativecandidateamongthemanyrunthroughs.

    The tableabovewillbepresented throughout thepaper, so it isworthwhile todiscusswhatvarious

    columnsmean.Insampleshowstheyearsthatwereusedasinsampletogeneratestrategycandidates.

    Kisthenumberofprofitablestrategiesfoundinsample,Excessistheaverageannuallogreturn,andK+

    is the number of profitable strategies in the outsample period (K+

  • Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,13

    II. S&P500Experiment

    Experiment Motivation: The goal for this experiment was to try to obtain the results in Allen,

    Karjalainen (1999)basedon theirexperimentswith theS&P500. Theexperimentwasundertaken to

    makesure thatthealgorithmwasworkingproperly,andto learnhowtosetupexperiments for later

    use. Essentially, the experiment hoped to achieve the same noexcess returns above buy and hold

    result.Allthevariablesusedarepubliclyavailable.

    Input Selection & Data: 2 variables were chosen: S&P 500 closing price and interest rates. The

    experimentwassetupexactlyasinAllen,Karjalainen(1999).

    1. S&P500:ThisisthedailyclosingpricefortheS&P500index,normalizedbydividingbya250day

    movingaverage.

    2. Interest Rates: 1month Treasury bill yields at first until 1992, then rolls over to Eurodollar

    depositratesthereafter.Notethatratesherearenotincludedasanindicator,butonlyasthe

    returnsforholdingcash.Thismeansthatthemodel,withtheonlyindicatorbeingprice,would

    neverdevelopa strategywhich staysoutof stockmarket if returns to cash in the treasuries

    marketarehigh.Rather,thestrategydevelopedwillbebasedsolelyonfunctionsderivedfrom

    pastprices,andrateswillonlymeasurereturnswhileholdingcash.

    Experimentsetup:Forthisexperimentapopulationofsize500and50generationswasused.Fitness

    wasdefinedascumulativeexcessreturnoverbuyandholdstrategy.Transactioncostsof0.1%,0.25%,

    and 0.5%. The training periodwas calculation deserves discussion. The data started in 1954, and

    trainingperiodsbeganevery5years,until1979. Whatthismeans isthefirsttrainingsetconsistedof

    datafrom1954toendof1958,and1959to1963isanothertrainingset,andsoon.Theyearfollowing

    trainingistheselectionperiod,whereprofitablestrategiesfromthetrainingperiodarekeptifandonly

    if they perform even better in the selection period, otherwise they are discarded. The outsample

    evaluationperiodwasalltheyearsfromoneyearaftertheselectionperiod(ortwoyearsaftertheend

    of the training period), until 2002. Each training set essentially leads to a new experiment; this is

    valuable toavoidoverfitting thealgorithm toevents thatarespecific toacertainperiodof time (for

    example,asuddenmarketcrash,etc).

  • Results & Discussion: It can be seen from the following table that under low transaction cost

    environment, theexcess returnsareessentially0 (meanapproximately0,withslightvariation),while

    excess returns become increasingly negative on average as transaction costs increase (which is

    expected).ThisisinlinewiththeresultsofAllen,Karjalainenaswellasgenerallyacceptedtheory:the

    S&P500 isoneofthemostefficientmarkets,andanystrategythatconsidersonlytechnicalpricedata

    (withoutevenconsiderationforothertoolsoftechnicalanalysis,suchasvolume)cannotmakereturns

    in excess of a buyandhold strategy, according to even the weakest forms of efficient market

    hypothesis.

    Primarily,thisexperimentwasusedtogainabetterunderstandingofthealgorithmandhow itworks.

    HavingconfirmedtheresultsofAllen,Karjalainen(1999),thenexttest involvesusingthealgorithmto

    searchfortradingstrategiesonanewsetofdata.

    Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,14

  • Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,15

    III. EmergingMarketsExperiment:ChinaASharesMarket

    ExperimentMotivation:PerhapstheS&P500issimplytooefficienttoallowtechnicalstrategiestoearn

    excessreturns.Ifthatisthecase,wouldtherebegainsfromapplyingthealgorithmtopotentiallyless

    efficientemergingmarkets? TheChinaAShares (opentopurchasebyChinese investorsandselected

    qualifiedforeigninstitutions)marketisinterestingandrelevantforseveralreasons.Firstandforemost,

    up until December 2007, China was experiencing an enormous bull market. At the same time,

    institutional rules forChinese financialmarketswere favorable for the algorithm: shortselling isnot

    permitted(ascurrentlysetup,thealgorithmcannotidentifyshortsellopportunities),andsharescannot

    be soldon the samedatepurchased (thealgorithmperforms calculationsonan interdaybasis,and

    doesnotgenerate intradaytradingstrategies). Finally,thepresenceofa largemassofretail investors

    potentiallyincreasesthelikelihoodofpotentialopportunities,comparedagainstthemoresophisticated

    hedgefunds,institutionalinvestors,etcthataredominantplayersinmoredevelopedmarkets.

    InputSelection&Data: Thisexperimentwas runanalogous to theS&P500experimentabove. The

    pricedata isChinaShanghaiAComposite Index closingpricesnormalizedbydividingby the250day

    movingaverage,andtheinterestratedatawasgovernmentmandatedChineseCentralBankOvernight

    rate.

    Experimentsetup: Theexperimentwassetupusingapopulationsizeof500,and50generations.

    Fitnessisdefinedascumulativeexcessreturnoverbuyandholdstrategy.Transactioncostswere0.1%,

    0.25%,and0.5%. The trainingperiodwas1998 to2002,selection2003 to2004,outsample2005 to

    2007. Note that recently the Chinesemarket has fallen quite dramatically,whichwould lower the

    returns tobuyandholdstrategy (andmake thealgorithmstrategy lookmore favorable) thesedata

    pointswerenotincorporatedintheexperiment.

  • Results&Discussion:

    Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,16

  • Themosteyecatchingfeatureofthetableonthepreviouspagemustbethesignificantnegativeexcess

    return,varyingfrom 22%to 30%. Note,howeverthattheTtestofoutsamplereturnsvs. insample

    returnsareessentiallyzero,sothestrategyisnotnecessarilyjustoverfittinginsampleandfailingout

    sample. Inavolatilemarket likeChina,amoreappropriatemeasureof return should indicate some

    measureofvolatilitysuchasaSharpeRatioorSortinoRatiowhichthebuyandholdbenchmarkdoes

    notaccountfor.Ifthetimeserieswasendedearlierforthisexperiment,thesenegativeexcessreturns

    wouldbemuchsmaller.

    Inthedevelopmentoftradingstrategies,negativeexcessreturnsarenot inherentlybad.Ifreturnsare

    significantlynegativewithahighstatisticalconfidencelevel,thenonecanprofitfromtakingtheinverse

    ofthesuggestedtradingrule.Ifhowever,returnsarejustslightlynegative,thereisnoclearstrategyto

    achieveprofit.However,becauseofChinas institutionalconstraintspreventing shortselling,evenan

    strongexcessnegativereturndoesnotallowforasuccessfultradingstrategy.

    Thereareseveralpossiblereasonswhyexcessreturnsweresignificantlynegative.

    Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,17

  • Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,18

    In theoutsampleperiod,Chinaexperiencedof the largestbullmarkets inhistorysimplybuying the

    stockat the startofoutsampleandholding ituntil2007producesannualgainsof40%+. As theA

    Shares indexclimbedto its2007peak, itoccasionallyexperiencedsmalldipsalongtheway.Any long

    only strategycompetingwithabuyandholdwouldneed to time thosedipsexactly right inorder to

    exhibitsignificantoutsampleperformanceinsuchabullmarket.However,thetradingstrategieswhich

    performed best in the insample period often stayed out of theA Sharesmarket and held cash for

    varying lengthsof timeduring the insample.While innormalmarkets thiswouldbeconsideredan

    essential part of a strategy in terms of riskmanagement, these strategies could be characterized as

    overly cautious in thismassivebullChineseoutsamplebullmarket .Byholding cash for even small

    periodsoftimebeforecomingbackintotheequitymarket,largeportionsofthebullrunweremissed.

    Theabovegraphedstrategyhighlightsanextremeexampleofanoverlycautiousstrategymissingabull

    market.

    Whilereturnsagainstthebuyandholdarenegativeasmeasuredonthespecificdatesused,theyare

    stillquitehigh inandofthemselves. Inthecontextofthehugebullmarketoftheoutsampleperiod,

    the best performing strategy from the run still returned over 30% annualized,which is very strong

    comparedtootherinternationalequitymarketreturnsoverthesameperiod.

    Second,onceagain,onlytechnicalpricedatawasconsidered.EssentiallythisexperimentwastheAllen,

    KarjalainenS&P500experiment,butdoneusingChinesemarketdata.

    Finally, the time seriesbeingconsidered isvery short, seeingas theChinesemarket isquitenascent.

    Thismeansthatthereisnotmuchtimeforthealgorithmtolearnduringthetrainingperiod,sinceitis

    inevitable to make the training period short enough to have meaningful selection and outsample

    evaluationperiods.Thedecisionwhethertouselargesamplesofdataandriskoverfittingversususing

    smallsamplesofdataandfindinglimitedpredictivevalueisalwaysatradeoff,andhighlightselements

    ofstrategydevelopmentthatarelargelyartratherthanscience.

    The Chinese AShares experiment suggests that strategies which trade only on past price data are

    generallynoteffectiveinthelongrun,evenwhenusedinalessefficientemergingmarket.

  • Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,19

    IV. GasolinePredictionExperiment

    ExperimentMotivation:Thegoalforthisexperimentwastodevelopamodelthroughuseofthegenetic

    algorithm topredictgasoline futuresprices.Predicting thegasoline futures contractpricepresents a

    particularlyrelevantandinterestingchallenge:thecommoditiesmarketsareinthemidstofahugebull

    run,andenergy issuesaretakingaprominentplaceonthemacroeconomicscene,both intheireffect

    oninflationandnationalsecurity.Withoilpricesover$100/bbl,thereisbothincreasingattentionpaid

    toandspeculation intheenergyfuturesmarkets.AlthoughthefrontmonthCushingcrudecontract is

    theworldsmostheavilytradedfuturescontract,thechoiceofadownstreamdistilledproduct(gasoline)

    rather than crude oil enables the algorithm to develop a model a model incorporating more

    fundamental data gathered from throughout the energy value chain. This was a new test for the

    algorithm, on nonfinancial, industry specific data being used to predict the gasoline futures price.

    Additionally,alldatausedinthisexperimentweregatheredfromfreepubliclyavailablesources,notably

    theUSEnergyInformationAdministration8,andtheInternationalEnergyAgency9.

    InputSelection&Data:14variableswerechosen,fromallalongthegasolinevaluechain,aswellasa

    select fewmacroeconomic,marketwidevariables.Thedataspans fromMay1985 throughDecember

    2007, which was chosen as the endpoint because of the lagged release of several of the variable

    indicatorseventhoughpricedataforthegasolinecontractwasavailablethroughtoday.

    1. Normalized (by 250day moving average) Front month gasoline future contract price: This

    NYMEXtradedfuturescontractisthevariablethatthealgorithmisattemptingtopredict,butit

    isalsoincludedasaninputvariable,sothatrelationshipsbetweenpastpricesandfutureprices

    (technicalanalysis)canbediscovered.DatafromtheNewYorkharborgradecontractwasused

    until2004,whenthemarketswitchedovertotheRBOB(reformulatedgasolineblendstockfor

    oxygenblending)specification,whichwasusedforthedurationofthedata.

    2. 3Monthgasolinefuturecontract:the3monthcontractisincludedinordertoprovidethestudy

    oftheshapeofthefuturescurve.Commodityfuturespricesaredrivenbythespotprice,costof

    storage,riskfreerate,andconvenienceyield,whichtakes intoaccountexpectationsofsupply

    8Officialwebsite:http://www.eia.gov.

    9Officialwebsite:http://iea.org.

  • Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,20

    anddemand,includingseasonalvariance.Byincludingthe3monthcontract,thealgorithmhas

    thepotentialtorecognizefuturescurveshapes,suchascontangoandbackwardation,which

    arecommonlyassociatedwithbearishandbullishsignalsforthemarket.Withtheexceptionof

    deliverydate,thesamecontractspecificationsasthefrontmonthcontractareused.

    3. Frontmonthcrudeoilcontract:thisNYMEXtradedcontractforlightsweetcrudeoilforCushing,

    Oklahomadeliveryisthemostheavilytradedfuturescontractintheworld.Crudeoilistheinput

    commodity to be distilled into gasoline, and its price is a key factor in the price of distilled

    products,includinggasoline.

    4. 3 Month crude oil contract: with the exception of delivery date, this contract is the same

    specification as the front month crude oil contract, and is included along the same line of

    reasoningas the3monthgasoline future, inorder to facilitate thedevelopmentofa futures

    curve.

    5. Front month heating oil future contract: the No. 2 grade NYMEXtraded heating oil future

    contractwaschosenbecauseofitsrelationshipwithgasolineasanothercrudeoilendproduct.

    Crude oil is distilled into a variety of finished products. The differential between the

    simultaneouspurchaseofcrudeoil futuresand the saleofvarious finishedproduct futures is

    known as the crack spread, and isperceived as an approximationof refineryprofits.Chief

    amongfinishedproductsaregasoline,heatingoilandjetfuel.Heatingoilisparticularlyrelated

    togasolinebecauseof the relativeseasonaldemand foreachproduct:heatingoil is inhigher

    demandinthewinterduringcoldweather,andgasolineisinhigherdemandinsummer,during

    peakdrivingseason.

    6. Thirdmonthheatingoilfuturecontract:withtheexceptionofdeliverydate,thiscontractisthe

    samespecificationasthefrontmonthheatingoilcontract,and is includedalongthesame line

    ofreasoningasthe3monthgasolinefuture,inordertofacilitatethedevelopmentofafutures

    curve.

    7. Percentagechange incrudeoilendingstocks:thisdata,gatheredmonthlyfromtheEIAwitha

    onemonth lag in release time, represents thepercentagechange inUSheldcrudeoilstocks.

    Sincecrudeistheinputforgasolineproduction,changeinavailablesupplywouldlogicallyhave

    aneffectonoutputgasolineprices.AlthoughthisdataonlyreferstoUSsourcesandtheenergy

  • Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,21

    futurescontractsrepresentatrulyglobalmarket,itisstillworthincludingbecausetheUSholds

    approximately20%ofglobalrefiningcapacity10,andthepredictedcontractvariablealsorefers

    toaUSdeliverypoint.

    8. U.S.percentutilizationofrefineryoperablecapacity:thisdata,gatheredmonthlyfromtheEIA

    witha3month lag in release time,mightbehelpful indetermining the relativedemand for

    distilledcrudeproducts.Averaging89.5%,periodsofextremehighorlowUScapacityutilization

    might be correlatedwith periods of high or low gasoline demand, orwith outages in other

    globalrefiningcapacity.

    9. U.S.OperableCrudeOilDistillationCapacity(ThousandsofBarrelsperday):thisdata,gathered

    monthlyfromtheEIAwitha3month lag inrelease,offers insight intothetotalUSdistillation

    capacity.

    10. U.S. Percentage Change FinishedMotorGasoline Stock: gatheredmonthly from the EIA and

    releasedwith a 3month lag. This is ameasure of end supply ofUS gasoline, andwould be

    expectedtocorrelatetosomedegreewithchangesinprice.

    11. Worldwide Rig Count: This measure of global on and offshore rigs, gathered monthly and

    releasedquarterlyfromBakerHughesInc.,isanindicatorofupstreamcrudesupplyandwidely

    usedthroughouttheindustry.

    12. CPIInflation:releasedmonthlybytheBureauofLaborStatistics,thisisanoncore(exfoodand

    energy)measureof inflation.Unliketheothervariables included,therenoclearrationalewhy

    CPIinflationwouldbealeadingindicatorforgasolineprices.However,oneoftheadvantagesof

    usingageneticalgorithmtobuildamodelratherthanhuman intuition isthatsometimesnew

    relationshipsarediscovered.

    13. S&P500Close:althoughthere isnearlynocorrelationbetweentheS&P500dailyreturnsand

    crude oil daily returns over the long run, theremight be an inverse relationship in times of

    extremelyhighenergyprices,representingamarketconsensusconcernabout inflatedenergy

    pricesslowingeconomicgrowth.

    10Source:EnergyInformationAdministration,WorldCrudeOilDistillationCapacity,January1,1970January1,2008

  • 14. 10year yield: collected daily, this was used as the return in the cash market when a long

    positionwasnottakeninthefuturesmarket.Itwasalsoavailableforthealgorithmtouseasan

    indicator, although logically it should have less predictive ability than other industryrelated

    data.

    Experimentsetup:Forthisexperiment,apopulationsizeof500wasusedfor50generations.Fitness

    wasdefinedascumulativeexcessreturnoverabuyandholdstrategy.Transactioncostsweresetto0%.

    Thetrainingperiodswere19862002,19911997,19962002,eachofwhichwasfollowedbyoneyear

    selectionperiod,andoutsampleevaluationswerefromoneyearafterselectionperiodto2008.

    Results&Discussion:Asthefollowingsummarytableshows,onaverage,slightnegativeexcessreturns

    werefound.

    Amongthevarioustradingrulesdevelopedthroughoutallthedifferent insampleperiods,onlytwoof

    therulesyieldedexcessreturns, intheamountsof2.48%and6.87%.Ofthetworulesoneseemsnon

    sensical,andtheotherisbasedonrelativechangeincrudestocks,gasolinestocksandheatingoilprices.

    Thefollowinggraphshowsthethebestperformingtradingstrategydeveloped,versusabuyandhold

    strategy.

    Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,22

  • 0%

    100%

    200%

    300%

    400%

    500%

    600%

    GasolineBuy&Hold GAStrategy

    Thebestrulefromthegasolineexperimentappearstobefairlyconservativeitstaysoutofthemarket

    forlongperiodsoftime(upto5years)duringperiodsoflowervolatility.However,itismorelikelyto

    enterthemarketduringperiodsofhighvolatility,ascanbeseenfromthetradesinthepastfewyears.

    Examiningthegraphrevealsthatalthoughthebeststrategyunderperformedthebuyandholdduring

    the total outsample as defined, during many parts of the outsample the strategy did indeed

    outperform.Thishighlightsthenotionthatmultiplemeasuresofreturn(e.g.SharpeRatio,SortinoRatio,

    etc.) should be examined before actually executing any strategy developed by this or any other

    algorithm.

    Thereareseveralpotentialreasonswhyexcessreturnsmightnothavebeenfound.First,thelengthof

    trainingdatawasrelatively limited,comparedtotheS&P500experimentforexample.Althoughthere

    were14differentpredictivevariablesincludedinthemodel,severaladditionalvariableswereunableto

    beincludedbecauseeithertheywerenotavailableforalongenoughtimespan,ortheywerenotfreely

    availableinthepublicdomain,forexampleDOEandEIAstatedpredictionsoffuturegasolineprices,or

    any measure of future or options volatility. Second, the use of a population size of 500 and 50

    generationsmighthavepossiblyoverfitthemodeltothepastdata,attheexpenseoffuturepredictive

    ability.Third,themodelhasnowaytotake intoaccountnonquantifiableevents,suchasthespike in

    gaspricescausedbyhurricaneKatrina in2005,oranyotherchange inpricecausedbythegeopolitical

    economy.

    Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,23

  • Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,24

    V. Conclusions:

    Across all experiments, no significant excess returns were found by using the genetic algorithm to

    developinvestmentstrategies.

    1. ForesightExperiment:Passing thisexperiment (successfully identifying theprofitable strategy

    thatwaspurposelyput into thedata)was theminimumnecessary condition for the genetic

    algorithmtobeabletopotentiallygenerateprofitabletradingstrategies. Thenextdaysprice

    wasgiventothealgorithm,and itwasabletosuccessfullydetectthisfacttogivethe intuitive

    tradingstrategythatismostprofitable.

    2. S&P 500 Experiment: This experiment recreates Allen and Karjalainens 1999 work, mostly

    undertakenasa learningexercise,butalsotoshowconsistencyofresults. An interestingnote

    here is inAllen andKarjalainensoriginalexperiment, the computational time requiredusing

    preyear 2000 technology took over a days worth of computing time; by comparison,

    approximatelythesameexperimenttookundertwohourstoprocesson2007hardware.

    3. ChinaASharesExperiment:Onanelementarytechnicallevel,ChinaASharesmarketappearsto

    besomewhatefficient,giveninstitutionalregulations.Resultsquestionvalidityofbuyandhold

    asabenchmarkagainstwhichgeneticalgorithmgenerated strategiesare compared,because

    buyandhold returnsare sensitive to the last fewdatapoints included in theexperiment. A

    profitablestrategycanlooklesspromising(andviceversa)justduetohighorlowreturnsonthe

    lastfewdays.Itisimportanttocompareexcessreturnsfrombuyandholdwithreturnsofout

    sampleminusinsample,anditsassociatedstatisticalsignificance;profitablestrategieswillshow

    significant positive (at least, nonnegative) difference between outsample and insample

    returns. There appears to remainpotential forprofitable trading strategies that incorporate

    additionalvariables,suchasfundamentals.

    4. GasolinePredictionExperiment: Althoughnoexcess returnswere found, the results seem to

    suggest that incorporatingadditional fundamentaldata into thegeneticalgorithmcan lead to

    improvedresults.

    Although no excess returns were found in these experiments, there are many ways to potentially

    improveboththestructureanduseofthealgorithm,bothintermsofbuildingblocksthemodelhasto

  • Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,25

    workwith (greater sophisticationof solution templates), and choiceof inputs into themodel (wider

    varietyofinputvariablespotentiallypreprocessedinlinewithfundamentalanalysis).Thereisroomto

    improvethemodelbothontheartandsciencefront.

    Theuseofgeneticalgorithmsforinvestmentstrategydevelopmentisanascentconceptwhichhasgreat

    potential.

    SuggestedFutureExperimentsandSpeculations:

    Penaltiesagainstnonsensicalandovercomplexoutput:Whendevelopinginvestmentstrategieswitha

    geneticalgorithm,thereisalwaystheriskofoverfittingthestrategytothepastdataset,attheexpense

    oflosingpredictiveabilityforthefuture.Oftenoverfitinvestmentstrategiesuseanaboveaveragelevel

    ofcomplexity,bothinvariablesusedandrandomnumbersgenerated.Onewaytoattempttocutdown

    on thismightbe tochange the fitness function fromonlyaccounting forpositiveadditions toexcess

    return to also incorporating a negative value, penalizing for excess levels of complexity. The new

    function would be in the form of [Fitness = +F*excess_return P*complexity_factor]. This could

    potentially reduce overfitting, and could alsomake execution easier, particularly in situationswhere

    liquidityandtransactioncostsplaylargeroles.

    Limitedsetoflinearbuildingblocks:Onepotentiallimitationofthealgorithmisthatallofthesolution

    templatesworkedwithinthispaperwerecomprisedoflinearbuildingblocks.Giventhatthemaximum

    possible branch depth of the solution candidateswas generally 6, it is possible to build polynomial

    strategies from the linear building blocks, but unlikely to build a polynomial strategy that can

    incorporateasignificantamountofvariables.

    Startingwithahumandevelopedstrategy,then lettingthegeneticalgorithmtweakspecificvariable

    levels: In addition to generating trading strategies from scratch, one potential use of the genetic

    algorithmwouldbetooptimizepartsofatradingstrategyalreadycreatedbyahuman.Forexample,an

    options trading strategy basedon a traderspersonalbelief about the volatility levels in themarket

    mightbedynamicallyhedgedintheunderlyingassetsmarketwithassistancefromageneticalgorithm.

    Another examplewould be if a fundmanager believes that an equity seems underpriced based on

    fundamentalanalysis,andwantstopurchasea largequantityofthestockwithoutsignificantlymoving

    the price. In this case, a genetic algorithm could be used in a constrained optimization model to

  • Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,26

    formulate thepurchaseof thepositionover a fixed amountof time,whileminimizing theeffectsof

    tradingcostsandmarketmovements.

    Purposelyoverfittingtothepastandthenadoptingtheinversestrategy:giventheriskofoverfitting

    tothepast,howcanoneuseoverfittingpurposefullytoachievesuperiorreturns?Oneofthetraditional

    beliefsofallvarietiesofefficientmarkettheoriesisthatstrategieswhichyieldaboveaveragereturnsin

    thepastbasedonanalysisofhistoricalpriceswillnotbeabletoconsistentlyoutperforminthefuture,

    becauseallpast informationbecomes incorporated intothemarket.Ifthis isthecase,one ideawould

    be topurposefullyoverfit thedata to thepast to create a strategy that yields extraordinary excess

    returnsonhistoricaldata,andtothentaketheinverseofthatstrategyasanewstrategygoingforward.

    Theideabehindthis,broadlylabeledcontrarianism,wouldbethatanythingthathasworkedsowellin

    thepastwouldunderperform inthefuturethankstotheinvisiblehandofthemarket,sotradingon

    theinverseofthatstrategycouldpotentiallythereforeoutperforminthefuture.

    Intradayconsiderations:Asmentionedearlier,thealgorithmisprogrammedinMathematica,whichis

    abittooslowtobepracticalinintradaytradingeachruntakesupwardsofseveraldaysofcomputing

    time (whendozensof indicatorsareused, forexample). However, itmaybepossible tousea small

    assortment of technical indicators (price, volume, measures of momentum, etc) and generate

    potentially profitable intraday trading strategies. For these applications, it may be preferable to

    programasimilaralgorithminafasterlanguagesuchasC++.

    Asset allocation experiment across multiple markets, asset classes: Genetic algorithms have been

    proven to be successful heuristics in many examples of constrained optimization problems, both in

    engineeringandinprojectfinance.Buildingonthisbodyofknowledge,oneareaforexperimentationis

    foraconstrainedoptimizationmodel tobe setup todistributea largeamountof totalassetsacross

    multipledifferentassets.Constraintscancomeintheformofminimuminvestmentineachassetgroup,

    orinthefitnessfunctionofmaximizingreturnswhileminimizingrisk.Thissortofmodelcanbeusefulin

    multiple scenarios, including global asset allocation among major asset management firms, risk

    management fornational financial institutions,ora fundof fundsallocatingassets todifferenthedge

    funds. This experiment could yield resultsbeneficial for investorsof all sizes, from sovereignwealth

    fundsdiversifyingtheircountrysequitymarketexposureallthewaydowntoanindividualchoosingan

    optimal401(k)allocation.

  • Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,27

    Testing of optimaldistributionofdata among training, selection andoutsampleperiods: Taking a

    quantitative approach to the issue of how to divide available data into training, selection and out

    sampletestingperiods, itwouldbebeneficialforonetoexaminetheeffectsofdifferentdatadivision

    strategies on the outsample returns of a common experiment. Although certain elements of data

    divisionareuniquetoeachparticularexperiment,perhapsonecouldfindvariousheuristicstohelpwith

    the process. Again, the need for this sort of experimentation highlights how the use of genetic

    algorithmsininvestmentstrategydevelopmentisbothanartandascience.

  • Dworkis&Huang,GeneticAlgorithmsandInvestmentStrategyDevelopment,28

    WorksCited

    Allen, Franklin, Risto Karjalainen. "Using genetic algorithms to find technical trading rules." Journal ofFinancialEconomics51(1999):245271.

    Buffett,Warren,multipleletterstoBerkshireHathawayshareholdersandvariousinterviews.

    FernnndezRodriguez, Fernando, Christian GonzlezMartel, Simn SosvillaRivero. "Optimization oftechnicalrulesbygeneticalgorithms:evidencefromtheMadridStockMarket."AppliedFinancialEconomics15(2005):773775.

    Hsieh,Tingya,HsinLungYu."GeneticAlgorithmforOptimizationofInfrastructureInvestmentUnderTimeResourceConstraints."ComputerAidedCivilandInfrastructureEngineering19(2004):203212.

    Tong, Tam and Chan. Genetic Algorithm Optimization in Building Portfolio Management. ConstructionManagementandEconomics19,(2001):601609.

    Wang, K.J., S.H Lin. "Capacity Expansion and Allocation for a Semiconductor Testing Facility underConstrainedBudget."ProductionPlanning&Control13(2002):429437.

    Whitman,MartinJ.,andMartinShubik.TheAggressiveConservativeInvestor.Wiley,1979.