You are on page 1of 31

A Publication of AppleInvestor

Design Build Use


Automated Trading Strategies
A Guide To What You Need to Know
TABLE OF CONTENTS
1. What is an Automated Strategy?
2. What are the Pros/Cons?
3. System Design Guidelines
4. The Development Lifecycle
5. Strategy Ideas
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
Disclaimer
1radlng lnvolves Lhe rlsk of loss. lease conslder carefully wheLher Lradlng ls
approprlaLe Lo your nanclal slLuauon. Cnly rlsk caplLal should be used when
Lradlng Lhe nanclal markeLs. asL resulLs are noL necessarlly lndlcauve of
fuLure resulLs. 1he rlsk of loss ln Lradlng can be subsLanual, please carefully
conslder Lhe lnherenL rlsks of any such lnvesLmenLs ln llghL of your personal
nanclal slLuauon.
All lnformauon and ldeas expressed ln Lhls book are based on Lhe oplnlons
and experlences of Lhe auLhor. And whlle Lhe auLhor has personally used Lhe
lnformauon provlded ln Lhls ebook Lo proLably Lrade ln Lhe equlLy and
fuLures markeLs, Lhls lnformauon purely a guldellne based on experlence. lf
you declde Lo accepL and apply Lhe ldeas and lnformauon conLalned hereln,
you do so aL your own rlsk.
no parL of Lhls publlcauon may be reproduced, sLored ln a reLrleval sysLem, or
Lransmlued ln any form or by any means, elecLronlc, mechanlcal,
phoLocopylng, recordlng, scannlng or oLherwlse, excepL as permlued under
Secuon 107 or 108 of Lhe 1976 unlLed SLaLes CopyrlghL AcL, or wlLhouL Lhe
wrluen permlsslon of Lhe auLhor.
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
CHAPTER ONE
What Is An
Automated
Strategy?
Introduction
What is an Automated
Trading Strategy?
An auLomaLed Lradlng sLraLegy ls a compuLer program deslgned Lo execuLe a
flnanclal sLraLegy LhaL has rules and conflguraLlon. 1hls program graphlcally dlsplays
Lhe Lradlng declslons of LhaL sLraLegy - l.e. enLrles, LargeLs, sLops on a Lradlng charL.
1he program can Lrade elLher slmulaLed or real money ln real Llme, and can be
compleLely auLonomous.

1he rules can be based on slmple condlLlons such as movlng average crossovers, or
Lhe sLraLegy could be complex and mulLl-dlmenslonal, requlrlng Lhe undersLandlng
of experL Lraders and quallfled programmers. LlLher way, Lhe program can be run by
anyone, and Lyplcally requlres a llnk Lo a dlrecL access broker.

1hls ebook wlll reference a speclflc Lrade plaLform and programmlng language. 1he
plaLform ls 1radesLaLlon, and Lhe programmlng language ls called LasyLanguage`.
1he nln[a1rader plaLform has a slmllar language called nln[aScrlpL.

LasyLanguage ls a proprleLary programmlng language developed by 1radesLaLlon Lo
creaLe cusLom lndlcaLors and algorlLhmlc Lradlng sLraLegles for Lhe markeLs. All
examples wlll be based on Lhe 1radesLaLlon plaLform uslng LasyLanguage. 8uL don'L
be fooled by Lhe sound of Lhe programmlng language name.LasyLanguage ls a
sophlsLlcaLed professlonal Lool.

1he language was deslgn Lo requlre no speclal compuLer programmlng skllls, where
commands conslsL mosLly of regular engllsh words, and speclallzed funcLlons LhaL
should be famlllar Lo any experlenced Lrader.

Lxample: 1he followlng sLaLemenL lf Lhe close ls greaLer Lhan Lhe hlgh of 1 day ago
Lhen buy 100 shares aL Lhe markeL," ls wrlLLen ln LasyLanguage llke so.

if Close > High of 1 Day ago then Buy 100 shares next bar at the market;
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
What is an Automated
Trading Strategy?
Some Lradlng plaLforms have sLraLegy bulldlng "wlzards" LhaL allow users Lo make
selecLlons from a llsL of commonly avallable Lechnlcal lndlcaLors Lo bulld a seL of
rules LhaL can Lhen be auLomaLlcally Lraded. 1he user could esLabllsh, for example,
LhaL a long Lrade wlll be enLered once Lhe 30-day movlng average crosses above Lhe
200-day movlng average on a flve-mlnuLe charL of a parLlcular Lradlng lnsLrumenL.

users can also lnpuL Lhe Lype of order (markeL or llmlL, for lnsLance) and when Lhe
Lrade wlll be Lrlggered (for example, aL Lhe close of Lhe bar or open of Lhe nexL bar),
or use Lhe plaLform's defaulL lnpuLs.

Many Lraders, choose Lo program Lhelr own cusLom lndlcaLors and sLraLegles or
work closely wlLh a programmer Lo develop Lhe sysLem. Whlle Lhls Lyplcally requlres
more efforL Lhan uslng Lhe plaLform's wlzard, lL allows a much greaLer degree of
flexlblllLy and Lhe resulLs can be more rewardlng.

1here ls a loL more Lo [usL chooslng or developlng a sLraLegy you lnLend Lo lnvesL
money ln. 8efore you do, you wanL Lo make sure Lhe sLraLegy has a good chance of
success, and LhaL means LesLlng Lhe sLraLegy, uslng a feaLure called back-LesLlng.

noL all plaLforms have back-LesLlng bullL ln. And Lhose LhaL do, have a wlde range of
capablllLy. lorLunaLely, Lhe 1radesLaLlon plaLform has one of Lhe mosL sophlsLlcaLed
and full feaLured back-LesLlng capablllLles of any Lradlng plaLform. lL ls absoluLely
essenLlal LhaL your sLraLegy ls Lhoroughly LesLed under a wlde range of markeL
condlLlons before puLLlng lL Lo work on real money.
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
I|gure 1. A sLraLegy LhaL Lrades AAL by openlng a poslLlon on lrldays
and closlng lL on Lhe followlng 1uesday, hence Lhe name Apple Cver
1he Weekend" (AAL-C1W)

given more than one explanation or


solution, the simplest one is the
preferred.

- Occams razor
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
CHAPTER Two
What Are
the Pros/
Cons of an
Automated
Strategy?
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
What are the Pros/Cons of an
Automated Trading Strategy?
1he advanLages of Lradlng wlLh an auLomaLed sysLem are numerous, and clearly
presenL a superlor alLernaLlve Lo Lradlng manually. Pere are [usL a few of Lhose
advanLages, followed by Lhe dlsadvanLages for balance:

- Ab|||ty to 8acktest: 8ackLesLlng applles Lradlng rules Lo hlsLorlc markeL daLa Lo
deLermlne Lhe vlablllLy of Lhe sLraLegy. When deslgnlng a sysLem for auLomaLed
Lradlng, all rules need Lo be absoluLe, wlLh no room for lnLerpreLaLlon (Lhe
compuLer cannoL make guesses - lL has Lo be Lold exacLly whaL Lo do). 1raders
can Lake Lhese preclse seLs of rules and LesL Lhem on hlsLorlc daLa before rlsklng
money ln llve Lradlng. Careful backLesLlng allows Lraders Lo evaluaLe and flne-
Lune a Lradlng sLraLegy, and Lo deLermlne whaL Lo expecL when you puL your
sLraLegy Lo work - Lhe average amounL LhaL a Lrader can expecL Lo wln (or lose)
per unlL of rlsk.
- L||m|nate Lmot|ona| Stress: AuLomaLed Lradlng sysLems run on compuLers, and
compuLers have no emoLlons, so Lhey are noL sub[ecL Lo Lhe frallLles of humans,
maklng rash changes Lo a sLraLegy ln a momenL of panlc. 8y keeplng emoLlons
ln check, Lraders have an easler Llme sLlcklng Lo Lhe sLraLegy and reallzlng Lhe
expecLed resulLs. Slnce Lrade orders are execuLed auLomaLlcally once Lhe Lrade
rules have been meL, Lraders wlll noL be able Lo heslLaLe or quesLlon Lhe Lrade.
ln addlLlon Lo helplng Lraders who are afrald Lo "pull Lhe Lrlgger", auLomaLed
Lradlng can curb Lhose who are apL Lo overLrade - buylng and selllng aL every
percelved opporLunlLy.
- Ach|eve Cons|stency: Cne of Lhe blggesL challenges ls Lo Lrade Lhe plan. Lven lf
a Lradlng plan ls wlldly proflLable, Lraders ofLen lgnore Lhe rules and alLer any
expecLancy Lhe sysLem would have had. 1here ls no such Lhlng as a Lradlng plan
LhaL wlns 100 of Lhe Llme - losses are a parL of Lhe game. 8uL losses can be
psychologlcally LraumaLlzlng, so a Lrader who has Lwo or Lhree loslng Lrades ln a
row mlghL declde Lo sklp Lhe nexL Lrade. lf Lhls nexL Lrade would be a wlnner,
Lhe Lrader has already desLroyed any expecLancy Lhe sysLem had. AuLomaLed
Lradlng sysLems allow Lraders Lo achleve conslsLency by Lradlng Lhe plan.
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
What are the Pros/Cons of an
Automated Trading Strategy?
- Accurate Lntr|es]Lx|ts: CompuLers respond lmmedlaLely Lo changlng markeL
condlLlons, auLomaLed sysLems are able Lo generaLe orders as soon as Lrade
crlLerla are meL. CeLLlng ln or ouL of a Lrade a few seconds earller can make a
blg dlfference ln Lhe ouLcome. As soon as a poslLlon ls enLered, all oLher orders
are auLomaLlcally generaLed, lncludlng proLecLlve sLop losses and proflL LargeLs.
MarkeLs can move qulckly, and lL ls demorallzlng Lo have a Lrade reach Lhe
proflL LargeL or blow pasL a sLop loss level - before Lhe orders can even be
enLered. An auLomaLed Lradlng sysLem prevenLs Lhls from happenlng.
- D|vers|f|cat|on: AuLomaLed Lradlng sysLems permlL Lhe user Lo Lrade mulLlple
accounLs or varlous sLraLegles aL one Llme. 1hls has Lhe poLenLlal Lo spread rlsk
over varlous lnsLrumenLs whlle creaLlng a hedge agalnsL loslng poslLlons. 1hls
would be lncredlbly challenglng for you Lo accompllsh, however lL ls efflclenLly
execuLed by a compuLer ln a maLLer of mllllseconds. 1he compuLer ls able Lo
scan for Lradlng opporLunlLles across a range of markeLs, generaLe orders and
monlLor Lrades.
D|sadvantages and kea||t|es of Automated 1rad|ng Systems: AuLomaLed Lradlng
sysLems have many advanLages, buL Lhere are some downfalls and realLles Lo whlch
you should be aware:

- Mon|tor|ng: AlLhough lL would be greaL Lo Lurn on Lhe compuLer and leave for
Lhe day, auLomaLed Lradlng sysLems do requlre monlLorlng. 1hls ls due do Lhe
poLenLlal for mechanlcal fallures, such as connecLlvlLy lssues, power losses or
compuLer crashes, and Lo sysLem qulrks. lL ls posslble for an auLomaLed Lradlng
sysLem Lo experlence errors or mlsconflguraLlon LhaL could resulL ln bad or
mlsslng orders. lf Lhe sysLem ls monlLored, Lhese evenLs can be ldenLlfled and
dealL wlLh qulckly.
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
What are the Pros/Cons of an
Automated Trading Strategy?
- Cver-opt|m|zat|on or Curve I|tt|ng: 1hough noL speclflc Lo auLomaLed Lradlng
sysLems, Lraders who employ backLesLlng Lechnlques can creaLe sysLems LhaL
look greaL on hlsLorlc daLa and perform Lerrlbly ln a llve markeL. Cver-
opLlmlzaLlon refers Lo excesslve curve-flLLlng whlch can lead Lo unrellable llve
Lradlng. lL ls posslble, for example, Lo Lweak a sLraLegy Lo achleve excepLlonal
resulLs on Lhe hlsLorlc daLa. 1raders someLlmes lncorrecLly assume LhaL a
Lradlng plan should have close Lo 100 proflLable Lrades or should never
experlence a drawdown Lo be a vlable plan. As such, parameLers can be
ad[usLed Lo creaLe whaL appears Lo be a "near perfecL" sLraLegy - LhaL
compleLely falls as soon as lL ls applled Lo a llve markeL. 1here are ways Lo
mlLlgaLe Lhls, a process called Lhe forward walk, where you LesL your sLraLegy
on never before seen daLa, called ouL of sample daLa. Cr you leL your sLraLegy
run ln slmulaLed mode for a whlle before allowlng lL Lo Lrade real money.
Go |t A|one or w|th a Serv|ce: AuLomaLed Lradlng ls a blg sLep LhaL can be lncredlbly
good for your Lradlng, so long as you are wllllng Lo puL ln Lhe Llme and efforL Lo do lL
Lhe rlghL way. And LhaL means geLLlng educaLed and galnlng experlence. uolng lL
yourself can be lncredlbly rewardlng, boLh emoLlonally, as you geL over your loslng
ways and onLo a paLh of more conslsLenL Lradlng proflLs, and moneLarlly, as
auLomaLed sysLems have a beLLer shoL aL execuLlng a proflLable sLraLegy Lhan a
human can.

1here are alLernaLlves Lo golng lL alone. ?ou could for example pay for alerLs from a
servlce LhaL has proven sLraLegles, greaL servlce, and a good Lrack record. ln Lhls
way you leave all Lhe experlenLlal deLalls Lo Lhe experLs, and you slmply Lrade. 1he
dlsadvanLage ls LhaL you are sLlll execuLlng Lhe Lrades manually, so lL wlll requlre
dlsclpllne Lo Lrade Lhe slgnals.

1he lasL opLlon ls Lo leL someone else Lrade your money wlLh Lhelr auLomaLed
sysLem. 1hls ls Lhe ulLlmaLe ln hands off Lradlng. Cf course Lhe caveaL here ls LhaL
Lhe servlce you choose has a proven record and ls rellable..
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
CHAPTER Three
System
Design
Guidelines
Design
Eight Guidelines to Improve
Your Chance of Success
ueveloplng sysLems can be Ledlous, and lnLeresLlng, lf noL fun work. 8uL before you
do anyLhlng, you should have a seL of prlnclples and guldellnes Lo help make Lhe
Lask of deslgnlng a Lradlng sysLem easler.

1. nave an |dea: 8ase your sysLem on a sound premlse. usually Lhls comes from
experlence or observaLlon of prlce movemenL. 8arely do good sysLem come
from wlld ass guesses.
2. State your |dea s|mp|y: 1he mosL obvlous and easlesL undersLood ldea usually
wlll be Lhe easlesL Lo solve, slmpler almosL always beaLs complex ln sysLems
deslgn.
3. Make no assumpt|ons: 1here's a dlfference beLween Lhlnklng you're rlghL and
knowlng you're rlghL. 1esL and verlfy before golng down a poLenLlally unfrulLful
paLh.
4. 1ack|e key e|ements f|rst: uevelop Lhe key rules of your sysLem flrsL, and make
sure you fully undersLand how Lhey conLrlbuLe Lo Lhe LoLal sysLem.
3. Watch for errors of om|ss|on: lorgeLLlng slmple Lhlngs llke lncludlng sllppage
and commlsslon, can wasLe a huge amounL of Llme chaslng someLhlng LhaL
appears Lo work well, only Lo flnd ouL lL's a dog.
6. uest|on too good to be true: lL may sound cllche, buL Lhere's few places Lhls
rlngs Lrue as much as sysLems deslgn. CfLen an excepLlon resulL ls slmply an
llluslon, and wlll fall ln rlgorous LesLlng.
7. 1ake noth|ng for granted: uo noL use anyLhlng LhaL can'L be verlfled. Check
everyLhlng, leave no sLone unLurned. A seemlngly lnslgnlflcanL error can ruln a
loL of hard work.
8. keep |t s|mp|e: Slmple ls eleganL, sLrlp away everyLhlng unLll you are lefL wlLh
only Lhe essenLlal parLs. 1hls guldellne alone wlll save you counLless hours of
unnecessary efforL.
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
System Aspects
Testing and More Testing
1esLlng, or more correcLly sLaLed, backLesLlng (and Lhe forward walk), ls of
paramounL lmporLance ln auLomaLed sysLems deslgn. Powever, done lmproperly
can lead Lo dlsasLrous resulLs, or dlscardlng a perfecLly good sLraLegy.

1he purpose of LesLlng ls Lo provlde a level of confldence ln your sLraLegy, as lL ls
applled Lo a wlde range of lnlLlal and fuLure condlLlons. ?ou wanL Lo deLermlne [usL
how robusL your sLraLegy ls across dlverse slLuaLlons, wheLher LhaL be dlfferenL
sLocks or dlfferenL markeLs, or boLh. 1esLlng and opLlmlzlng a sLraLegy for a slngle
sLock or markeL can lead Lo curve flLLlng, and LhaL usually leads Lo lneffecLlve, non-
robusL sysLems.
Risk Management
Many Lraders and analysLs Lhlnk LhaL wlLh proper rlsk managemenL you can make
[usL abouL any sLraLegy proflLable. WhaL Lhey usually mean by Lhls ls placlng LlghL
sLops. lL slmply ls noL LhaL easy. Whlle lL ls Lrue LhaL sLops-based rlsk managemenL
can be lmporLanL, lL does noL represenL all posslble soluLlons Lo rlsk managemenL.
lor example, some sLraLegles can use volaLlllLy as an effecLlve rlsk managemenL
Lool, or adherence Lo speclflc demographlcs, llke Llmes Lo Lrade, or noL Lo Lrade, or
Lhe amounL of leverage LhaL ls used.

8lsk managemenL ls a complex Loplc, LhaL needs Lo be consldered from many
dlfferenL aspecLs of a sysLem. And ls ofLen deLermlned by Lhe naLure of Lhe sLraLegy,
or Lhe speclflc characLerlsLlcs of Lhe markeL belng Lraded.
1he deslgn of a sysLem can be qulLe complex, wlLh many movlng parLs. So as an
apprenLlce of sysLems deslgn you musL know where Lhe focus should be. 1he
followlng Loplcs are Lhe prlnclple Lhlngs of concern for a sysLem developer, ln no
parLlcular order.
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
Risk and Volatility
Assesslng rlsk ls paramounL. Cne should conslder Lhe exLremes of rlsk and Lhe
Lypes. 1he flrsL ls evenL rlsk, seen as unpredlcLable prlce movemenL. And Lhe oLher
end of Lhe exLreme ls caLasLrophlc rlsk, whlch LhreaLens Lo brlng you down. ?our
rlsk sLraLegy needs Lo accounL for, and handle boLh exLremes.

1he sLandard for measurlng all rlsk Lypes ls wlLh Lhe sLandard devlaLlon of reLurns,
called volaLlllLy. When Lalklng abouL Lhe volaLlllLy of your porLfollo, or Lhe
percenLage of rlsk, lL ls ln Lerms of one sLandard devlaLlon of your annuallzed
reLurns (32 weeks). 1he greaLer Lhe devlaLlon of reLurns, Lhe greaLer Lhe rlsk.

To be uncertain is to be uncomfortable,
but to be certain is to be ridiculous.

- Chinese Proverb
Returns and Rate of Return
ls Lhere anyLhlng more lmporLanL Lhan reLurns? Well, no. ?our reLurns and raLe of
reLurn are fronL and cenLer when LesLlng and evaluaLlng acLual reLurns. lL's Lhe
prlmary Lhlng for deLermlnlng lf a sLraLegy ls performlng or noL.

volaLlllLy has a dlrecL correlaLlon Lo reLurns, lL wlll ulLlmaLely deLermlne your
expecLaLlons. lL ls besL Lo Lalk of reLurns ln Lerms of annuallzed daLa. 1haL way you
can always compare sysLems based on comparable daLa.
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
Draw Down
A drawdown is the reduction of capital after a series of losing trades. This is
normally calculated by getting the di"erence between a relative peak in capital
minus a relative trough. Draw down is noted as a percentage of the initial trading
capital.

Every system has drawdowns, no matter how smooth your optimized and curve
tted equity curve looks. Your job is to understand and minimize the frequency
and depth of drawdowns.

From principles is derived probability,


but truth is obtained only from facts.

- Dixon G. Watts
Probability
1o probablllLy of someLhlng occurrlng, or selecLlng someLhlng, can only be
measured, noL predlcLed. robablllLy ls Lhe measure, ln Lerms of a percenLage, LhaL
someLhlng wlll happen. 1here are Lwo laws of probablllLy LhaL we'll use ln our
analysls and deslgn of auLomaLed sysLems.

1. Law of add|t|on: 1he probablllLy of selecLlng someLhlng, ls Lhe sum of Lhe
lndlvldual probablllLles LhaL could occur, llke Lhe probablllLy of drawlng a Lype
of wlnnlng hand ln poker.
2. Law of mu|t|p||cat|on: 1he probablllLy of Lwo occurrences happenlng ln
successlon ls Lhe mulLlpllcaLlon of Lhe Lwo lndlvldual probablllLles, llke Lhe sLarL
of a wlnnlng sLreak.
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
I|gure 2: LqulLy charLs are an lmporLanL Lool for evaluaLlng long Lerm
performance. 8uL you need Lo undersLand whaL Lo look for.
Conclusion
There are many more important topics you will need to not only be aware of, but
need to develop mastery over. These guidelines will keep you focused on the
most important aspects when designing your automated systems.

The thing most people dont consider when developing a system, no matter how
simple or comprehensive your system isyou are putting it to work in a market
where the unexpected is a virtual certainty. And even the most sophisticated
system cant account and handle all possibilities.

However, following guidelines, and keeping the important things front and
center, will give you a very good chance of creating a protable system.
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
CHAPTER Four
The System
Development
Lifecycle
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
Design Lifecycle
Kaizen - a Continuous
Improvement Process
kalzen ls an anclenL !apanese phllosophy LhaL means good change. lL' a recognlLlon
LhaL mosL everyLhlng ls ln flux and changlng, lL ls Lhe one consLanL we can counL on.
So, our developmenL process, even our Lradlng should accounL for LhaL change,
expecL lL and even embrace lL. So, below ls Lhe conLlnuous lmprovemenL process or
llfecycle we use Lo develop sysLems.
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
Where Are the Ideas?
WhaL you are looklng for are paLLerns ln Lhe markeL, Lhose paLLerns could appear ln
fundamenLal daLa of lndlvldual companles, Lhe dynamlcs of cerLaln markeLs, prlce
acLlon (charLs), Lhe relaLlonshlp beLween bonds and currencles, or Lhe affecL of
economlc reporLs. 1hls ls by far noL a comprehenslve scope from whence ldeas
come, Lhere's a wlde varleLy of areas Lo dlg up sLuff, lL would Lake several e8ooks Lo
[usL scraLch Lhe surface.

Cnce you have found an ldea, and recognlzed a recurrlng paLLern LhaL may be
explolLable, Lhe nexL sLep ls Lo bulld a model and LesL your hypoLhesls. Modellng
and ways Lo model ls [usL as blg a sub[ecL as where Lo flnd ldeas. MosL people sLlck
wlLh a speclalLy, buL LruLh be Lold, llke any professlon, lL's good Lo be famlllar wlLh a
number of Lechnlques.
Building a Model
1he purpose of a model ls Lo boLh explaln and forecasL how prlce changes, or
wheLher a markeL mlghL be over exLended, or Lo expose whaLever effecL lL ls LhaL
your blg ldea has hypoLheslzed. And Lo develop an lnLlmaLe knowledge of Lhe
domaln you lnLend Lo Lrade.

1he besL models are Lhose LhaL speclflc Lhe relaLlonshlp and seL Lhe facLors ln
advance, Lhen LesL Lhe model over reams of daLa Lo verlfy Lhe premlse. lf you
engage ln ad[usLlng Lhe daLa Lo flL Lhe premlse, uslng regresslon analysls or mass
LesLlng, Lhen you are engaglng ln curve flLLlng. Maklng someLhlng work wlLh Lhe
beneflL of hlnd slLe. 1hese models rarely are effecLlve on new daLa on a conslsLenL
basls.
?ou have Lo sLarL somewhere, and LhaL's wlLh Lhe lnlLlal ldea, someLhlng LhaL you
belleve has a good change of explolLlng an edge. lL's all abouL, flndlng an edge,
flndlng someLhlng LhaL oLhers may have overlooked, LhaL can produce proflL. ?our
ldea, your hypoLhesls, ls usually found Lhrough exLenslve research, or personal
experlence, or a varlaLlon of your LhoughL comblned wlLh someone else's proven
ldea. 1hls ls by far Lhe mosL bounLlful place greaL sysLems are born.
Everything Starts
with the Big Idea
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
1he ldea you sLarL wlLh ls ofLen dlfferenL Lhan Lhe one you end up wlLh, Lhls ls noL
unusual Lhe case durlng Lhe process of dlscovery. lL may be slmllar, someLlmes lL
may Lake a compleLely dlfferenL dlrecLlon. 1he key ls noL Lo be glued Lo your orlglnal
premlse lf someLhlng surprlslngly good Lakes you ln a compleLely dlfferenL
dlrecLlon. SomeLlmes good ldeas are llke LhaL, good luck ls born of hard work, and
lnLlmaLe knowledge of your model and domaln.
Evaluate and Pivot

You have to learn the rules of the game.


And then you have to play better than
anyone else.

- Albert Einstein
8ules are lmmuLable, aL leasL once Lhey are ln place. 8uL creaLlng rules ls a process
LhaL requlres lnLlmaLe knowledge of your model and how lL behaves under a wlde
range of slLuaLlons. 8ules generally lnclude Lhe llmlLs you puL on Lhe sLraLegy, rlsk
and money managemenL. 8uL Lhey may also lnclude handllng Lhlngs speclflc Lo Lhe
asseL, llke conLracL roll overs or earnlngs daLes.
lf you are bulldlng a sysLem based on Lechnlcal paLLerns, many of Lhese rules are
well esLabllshed. lL's usually a good ldea Lo use Lhese rules, unless you found a clear
and measurable edge LhaL dlcLaLes someLhlng else.
lL's hard Lo oversLaLe LhaL your knowledge of your model ls by far Lhe blggesL
advanLage you have ln developlng a proflLable sysLem. lf Lhls sounds llke l'm
repeaLlng myself, Lhen so be lL. So long as lL makes a lasLlng lmpresslon upon you.
Build Rules
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
A good auLomaLed sLraLegy wlll work across dlfferenL asseLs, or across dlfferenL
markeLs. A sLraLegy may have a parLlcular nlche, for example lL ls deslgned Lo Lake
advanLage of hlgh beLa sLocks, so ln lL should work ln a conslsLenL manner across a
wlde range of hlgh beLa sLocks. lf lL works for one sLock and falls on oLhers, Lhen
LhaL sLraLegy ls fraglle.

8ackLesLlng

1he furLher back you can go wlLh backLesLlng, and show conslsLenL resulLs, Lhe
beLLer. 1he more daLa polnLs you can geL ln your LesLs, Lhe more Lrades you can
show, Lhe greaLer llkellhood your sLraLegy wlll show poslLlve resulLs ln Lhe fuLure.

Cne way Lo compare sLraLegles, ls Lo apply a slmple formulae for robusLness. lL
requlres LhaL you have Lhree daLa polnLs for comparlson, Lhe proflL facLor, Lhe wln
raLe and Lhe raLlo of average proflL Lo loss. Pere's Lhe formula:
k = I x Wk x avg 2L
k = robusLness
I = proflL facLor
Wk = wln raLe
2L = average proflL / average loss
1he LargeL ls 2.0, whlch represenLs a very good, and robusL sysLem. 1hls ls Lhe
sLandard you are reachlng for. A sysLem LhaL has an 8 facLor > 1.4 ls accepLable.
AnyLhlng over 2, ls llke Lhe 8lchLer scale for earLhquakes, lncreaslng numbers
become exponenLlal. lor example, lL ls unusual Lo see a sysLem wlLh a 8 facLor of 4
or greaLer, Lhls ls a poLenLlally greaL sysLem.
1hls ls a rudlmenLary meLhod for checklng robusLness, buL effecLlve, lL helps weed
ouL Lhe dogs from Lhe poLenLlal wlnners. 1here are many oLher characLerlsLlcs of a
sysLem LhaL come lnLo play LhaL may boL show ln Lhls calculaLlon. So don'L
compleLely rely on Lhls calculaLlon for your flnal declslon. lL's a guldellne.
Check for Robustness
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
8ackLesLlng ls Lhe process of runnlng your sLraLegy agalnsL hlsLorlc daLa, and
generaLlng sLaLlsLlcs LhaL can be evaluaLed. 1he goal of backLesLlng ls Lo see how
your sLraLegy performs agalnsL varlous condlLlons. lL ls also Lhe goal Lo flnd Lhe
opLlmal conflguraLlon across Lhese condlLlons. 1he range of condlLlons wlll vary
dependlng upon Lhe sLraLegy, buL lL could be dlfferenL sLocks, asseL classes,
markeLs, economlc condlLlons, whaLever ls relevanL Lo Lhe purpose of Lhe sLraLegy.

1he 1radesLaLlon plaLform has a comprehenslve backLesLlng sysLem. lL allows you Lo
LesL vlrLually every condlLlon, for any perlod of Llme. 1he generaLed reporL ls a
comprehenslve seL of sLaLlsLlcs, Lrades and charLs LhaL provlde a full vlew of your
sysLem. 1he backLesLs are conducLed dlrecLly ln Lhe CharL Analysls wlndow. 1he
prlmary purpose ls Lo flnd Lhe besL lnpuL parameLers Lo your sLraLegy.
Backtesting
I|gure 3: 1radesLaLlon SLraLegy erformance reporL showlng sLaLs and
average monLhly proflL.
1he operaLlve word ln releaslng your creaLlon Lo Lhe real world ls paLlence. 1esL
wlLh slmulaLed daLa before you commlL real money. Allowlng a perlod of Llme for
your sLraLegy Lo reacL Lo real world daLa wlll yleld lnvaluable lnformaLlon. 1he blg
quesLlon ls decldlng how long ls long enough for your LesLlng. 1hls ls a complex
quesLlon, because lL depends on a number of condlLlons, such as Lhe Llmeframe Lhe
sysLem Lrades ln, wheLher Lhe lnlLlal condlLlons have LesLed your premlse
sufflclenLly. WhaL lL all comes down Lo ls Lhls.do you have enough daLa Lo make a
sLaLlsLlcally slgnlflcanL case.
Simulate Before going Live
Go Live or Not
?ou have Lhe backLesLed, forward walked, checked LhaL lL's robusL and acqulred
enough daLa from runnlng agalnsL llve unsampled daLa. now lL's Llme Lo declde, do
you release lL Lo Lhe wlld and LrusL lL wlLh real money?

lL's an exclLlng proposlLlon Lo puL your creaLlon lnLo producLlon, wlLh Lhe
expecLaLlon lL's golng Lo sLarL maklng money. And lf you have greaL confldence ln
your fall-safes, your money and rlsk managemenL, Lhen leL lL go. 8uL lL's almosL
always a beLLer ldea Lo go back Lhrough your guldellnes check llsL, maybe more
Lhan once, before you go llve.

Also, lf posslble, lL's probably a good ldea Lo sLarL wlLh Lhe smallesL poslLlon slze
posslble, so long as Lrade cosLs don'L become Loo blg of a facLor ln your flnal go-
nogo declslon. 8emember, Lhere's no shame ln golng back Lo Lhe drawlng board, ln
facL lL's parL of Lhe normal sysLem deslgn llfecycle.
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
CHAPTER Five
Strategy
Ideas
Strategy Ideas
1he besL ldeas Lo sLarL wlLh are ones LhaL have already been proven Lo work. Cf
course Lhls does noL mean you should slmply copy a sLraLegy and run wlLh lL,
wlLhouL flrsL valldaLlng your lmplemenLaLlon of lL.

lf you have ever heard Lhe phrase, sLandlng on Lhe shoulders of glanLs, alLhough Lhe
meanlng has many hlsLorlcal conLexLs, ln our case lL means lL ls besL Lo copy Lhe
work of masLers, and bulld upon lL. And Lhere's plenLy of masLerful work ouL Lhere
Lo copy, so long as lL ls ln Lhe publlc domaln, or you have expressed permlsslon Lo
use lL of course. SLeallng ls frowned upon.

1he easlesL Lo lmplemenL ldeas lnvolve slmple overboughL and oversold condlLlons
uslng an osclllaLor llke 8Sl or SLochasLlc. ?ou buy when oversold, and sell when
overboughL, a slmple supply and demand sLraLegy. Where lL can geL lnLeresLlng ls
where you add addlLlonal fllLers LhaL musL conflrm Lhe oversold-overboughL
condlLlon.

1he besL chance of success ls Lo flnd a conflrmlng lndlcaLor LhaL ls based on non-
correlaLed daLa. ln oLher words, lf your overboughL-oversold lndlcaLor ls based on
prlce acLlon, perhaps Lhe conflrmlng lndlcaLor, or fllLer, should be based on volume
or volaLlllLy, or maybe even Lhe prlce acLlon of Lhe relaLed markeL lndex.

We have always been shameless about


stealing great ideas.

- Steve Jobs
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
1he Llmeframe your sLraLegy works ln could have profound affecL on Lhe reLurns lL
makes. Also Lhe Llme of day, or range of daLes lL ls allowed Lo Lrade can be huge
dlfferenLlaLors. 1he cholces you make wlll reflecL your knowledge of Lhe domaln.
8emember when we Lalked abouL modellng ln Lhe llfe cycle of deslgnlng sysLems,
and how lmporLanL lL was Lo undersLand your domaln?

Pere are four baslc caLegorles of algorlLhmlc Lradlng sLraLegles, Lhey are llsLed ln
order of popularlLy, noL necessarlly ln order of proflLablllLy:
- 1rend fo||ow|ng - ulrecLlonal sLraLegy, LhaL can be bulllsh or bearlsh.
- 1rend reversa| - ldenLlfles Lhe plvoL polnLs, or cycllcal naLure of a securlLy.
- Vo|at|||ty - Lhere are a wlde range of volaLlllLy Lrades, from selllng of opLlons
premlum, Lo conLango and backwardaLlon.
- Arb|trage - markeL neuLral, evaluaLes Lhe relaLlonshlp beLween securlLles or
markeLs, and proflLs from a dlvergence ln LhaL relaLlonshlp, followed by an
almosL cerLaln regresslon back Lo Lhe mean. Plgh frequency algos are usually
Lhls Lype.
1rend fo||ow|ng ls also an easy Lo undersLand problem, and lL can be Lremendously
proflLable, especlally ln longer Llmeframes lf you plck Lhe rlghL dlrecLlon. ?ou can
also experlence Lremendous drawdowns, because of Lhe laLlLude you musL afford
Lhese Lypes of sLraLegles. 1hey usually work besL wlLh advanced money
managemenL.
1rend reversa|, Lrles Lo plck Lops and boLLoms, oversold and overboughL, supply
and demand, exLreme Lo exLreme. And whlle Lhls ls probably Lhe easlesL sysLem Lo
bulld, lL ls also whaL 80 percenL of Lhe algo Lraders are Lrylng Lo do as well. MosLly
because lL ls easy Lo bulld, noL necessarlly Lhe mosL proflLable. lL's hard Lo plck Lops
and boLLoms, Lhey are so eluslve. So whlle Lhe problem seems relaLlvely easy, Lhe
soluLlon apparenLly ls qulLe dlfflculL.
Vo|at|||ty ls noL well undersLood by mosL Lraders, lL ls complex due Lo Lhe naLure of
Lhe underlylng fuLures. 8uL volaLlllLy L1ls are easy LargeLs due Lo conLango. Slmply
sell all overboughL occurrences, nLvL8 buy. verlfy yourself and look aL any weekly
charL of a volaLlllLy-based L1l. !"#$%& ()*+ ,$-% ./01/023 #4")3"5
Strategy Ideas
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
Pere's a volaLlllLy sLraLegy based on 8olllnger bands. lL's called Lhe uouble 8olllnger.
lL works besL wlLh hlgh beLa sLocks, LhaL are Lrendlng ln [usL abouL any Llmeframe.
1he sLraLegy uses Lwo enveloplng 8olllnger bands, and no sLops. 1he sLraLegy
provldes naLural sLops. Pere's an lllusLraLlon of how Lhe sLraLegy ls modeled:
Volatility Example
I|gure 4. uouble 8olllnger bands, wlLh Lhe movlng average aL 26 and
Lhe ouLer band seL aL 1.3 sLd dev, and lnner aL 0.73 sLd dev.
1he sLraLegy Lrles Lo caplLallze on sLrong moves. Pere's Lhe algorlLhm:

Buy 2X positions if price closes above the outer upper band
Sell 1X position if price closes below inner upper band
Sell 1X position if price closes below moving average

Sell 2X positions if price closes below the outer lower band
Buy to cover 1X position if price closes above inner lower band
Buy to cover 1X position if price closes above moving average
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
1he baslc premlse of your sLraLegy should produce a number of orders LhaL are less
Lhan opLlmal. lL's noL a problem wlLh your sLraLegy, lL's Lhe naLure of sLaLlsLlcal
probablllLy and ever-changlng envlronmenLal condlLlons. 1o lmprove Lhe overall
effecLlveness of Lhe sLraLegy, meanlng Lhe percenL wlnners and raLe of reLurn, lL wlll
be necessary Lo fllLer ouL as much of Lhe non-opLlmal populaLlon as posslble.

1hese sLraLegy fllLers are sLraLegles unLo Lhemselves, and can Lake many forms. 1he
besL way Lo vlew Lhem ls as nolse suppressors. lllLers remove Lhe good wlLh Lhe
bad, so you wlll lose some of Lhe clean slgnal, buL Lhe overall effecL wlll be Lo
ellmlnaLe much of Lhe bad slgnal.
Strategy Filters
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
I|gure S. MomenLum sLraLegy wlLh a volaLlllLy raLe of change fllLer.
As you bulld a llbrary of sLraLegles, you wlll begln Lo reallze LhaL much of Lhe
funcLlonallLy can be reused across Lhe core ldeas. 1hlngs such as sLops, and Lrade
ladders, and fllLers.

lL would be advlsable Lo bulld and LesL Lhese componenLs separaLely, and add Lhem
ln uslng a klnd of plug and play archlLecLure. 1hls way you wlll save a Lremendous
amounL of efforL and Llme, and lncrease Lhe sLablllLy of your sysLems many fold.

1he prevlous example ls a good example, where Lhe sLraLegy and fllLers are
lmplemenLed as lndlcaLors, and can be used as graphlcal guldes when creaLlng your
sLraLegy.
Strategy Components
CopyrlghL 2014 by Lrnle varlLlmos. All rlghLs reserved.
Register for a Free Webinar
To Learn About
Automated Trading Now
CREATE, BUILD, RUN YOUR OWN STRATEGIES the automated
trader program is a coaching and online training will teach
you step-by-step to create, build and run automated trading
strategies.
Register NOW
C||ck nere
to keg|ster

You might also like