Anda di halaman 1dari 125

1

Adapt ive Modeler


Version 1. 2.7

Users Guide


Copyri ght 2003 - 2010 Ji m Wi t kam. Al l right s reser ved.






2
Bri ef Cont ent s:

1. I nt roduct i on .... .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 11
1.1 Agent - based model s and fi nanci al market s ...... .......... .......... .......... .......... ...... 11
1.2 How Adapti ve Model er uses agent - based model s ........ .......... .......... .......... ...... 11
1.3 Adapt i ve Model ers possi bili ti es... .......... .......... .......... .......... .......... .......... ...... 11
1.4 Speci fi cat i ons ....... .......... .......... .......... .......... .......... .......... .......... .......... ...... 13
1.5 Syst em r equi rement s ...... .......... .......... .......... .......... .......... .......... .......... ...... 13
1.6 I nst all at ion .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 14
1.7 Conventions and t ermi nology ..... .......... .......... .......... .......... .......... .......... ...... 14
1.8 How t o use t hi s Users Gui de? .... .......... .......... .......... .......... .......... .......... ...... 15
1.9 Get t i ng hel p ......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 15
1.10 Exampl es. .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 15
2. Get t i ng St art ed Tut ori al ........ .......... .......... .......... .......... .......... .......... .......... ...... 16
Lesson 1: Model configurati on.......... .......... .......... .......... .......... .......... .......... ...... 16
Lesson 2: Model ini ti ali zat ion . .......... .......... .......... .......... .......... .......... .......... ...... 18
Lesson 3: Model evol uti on ..... .......... .......... .......... .......... .......... .......... .......... ...... 19
Lesson 4: Agent s ....... .......... .......... .......... .......... .......... .......... .......... .......... ...... 22
Lesson 5: Eval uati ng forecast i ng abi li ti es .... .......... .......... .......... .......... .......... ...... 29
Lesson 6: Trading Si mul at or .. .......... .......... .......... .......... .......... .......... .......... ...... 32
Lesson 7: Creat i ng your own model s .......... .......... .......... .......... .......... .......... ...... 34
3. How does Adapt i ve Model er work? ... .......... .......... .......... .......... .......... .......... ...... 35
3.1 Agent - based Model ......... .......... .......... .......... .......... .......... .......... .......... ...... 35
3.2 Trading Syst em .... .......... .......... .......... .......... .......... .......... .......... .......... ...... 39
4. Market Dat a .... .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 42
4.1 Dat a r et ri eval ....... .......... .......... .......... .......... .......... .......... .......... .......... ...... 42
4.2 Quot e fil e format requi rement s... .......... .......... .......... .......... .......... .......... ...... 44
5. Model confi gurat ion.... .......... .......... .......... .......... .......... .......... .......... .......... ...... 48
5.1 General paramet er s ........ .......... .......... .......... .......... .......... .......... .......... ...... 48
5.2 Agent - based Model paramet er s .. .......... .......... .......... .......... .......... .......... ...... 50
5.3 Genome paramet ers ....... .......... .......... .......... .......... .......... .......... .......... ...... 53
5.4 Evolut ion paramet er s ...... .......... .......... .......... .......... .......... .......... .......... ...... 56
5.5 Trading Syst em par amet er s ....... .......... .......... .......... .......... .......... .......... ...... 57
5.6 Savi ng and rest oring model confi gurat ions....... .......... .......... .......... .......... ...... 59
6. User I nt erface . .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 60
6.1 Cont rolling model evoluti on........ .......... .......... .......... .......... .......... .......... ...... 60
6.2 Dat a seri es t r ee vi ew ...... .......... .......... .......... .......... .......... .......... .......... ...... 60
6.3 Chart s ....... .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 61
6.4 Current Values ..... .......... .......... .......... .......... .......... .......... .......... .......... ...... 65
6.5 Trading Si gnal s .... .......... .......... .......... .......... .......... .......... .......... .......... ...... 65
6.6 Popul at ion Window.......... .......... .......... .......... .......... .......... .......... .......... ...... 65
6.7 Performance Overvi ew .... .......... .......... .......... .......... .......... .......... .......... ...... 67
6.8 Market Dept h ....... .......... .......... .......... .......... .......... .......... .......... .......... ...... 69
6.9 Agent Window...... .......... .......... .......... .......... .......... .......... .......... .......... ...... 70
6.10 Logger ..... .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 70
6.11 Cust omi zi ng t he User I nt erf ace. .......... .......... .......... .......... .......... .......... ...... 71
6.12 St yl es...... .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 72
6.13 Comput at i on performance i ssues ........ .......... .......... .......... .......... .......... ...... 73
7. Tradi ng. .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 74
7.1 Eval uati ng forecast i ng success ... .......... .......... .......... .......... .......... .......... ...... 74
7.2 Usi ng t he Tradi ng Si mul at or ....... .......... .......... .......... .......... .......... .......... ...... 74
7.3 St at i st i cal Si mul ations ..... .......... .......... .......... .......... .......... .......... .......... ...... 75
8. More about dat a seri es ......... .......... .......... .......... .......... .......... .......... .......... ...... 76
8.1 Paramet er s .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 76
8.2 Movi ng Averages .. .......... .......... .......... .......... .......... .......... .......... .......... ...... 78
8.3 Autocorrel at ion..... .......... .......... .......... .......... .......... .......... .......... .......... ...... 78
8.4 Recomput abl e vs. non- recomput abl e dat a seri es ........ .......... .......... .......... ...... 79
8.5 Memory l i mi t at i ons ......... .......... .......... .......... .......... .......... .......... .......... ...... 79
9. Exporti ng dat a. .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 81
9.1 Export Set t i ngs..... .......... .......... .......... .......... .......... .......... .......... .......... ...... 81
9.2 Other Export i ssues......... .......... .......... .......... .......... .......... .......... .......... ...... 82
3
10. Bat ch processi ng and aut omat i on... .......... .......... .......... .......... .......... .......... ...... 84
10.1 Creat i ng a bat ch process.......... .......... .......... .......... .......... .......... .......... ...... 84
10.2 St art ing a bat ch.. .......... .......... .......... .......... .......... .......... .......... .......... ...... 86
10.3 Saving and opening bat ch set t i ngs...... .......... .......... .......... .......... .......... ...... 86
10.4 St art ing a bat ch from t he command line ........ .......... .......... .......... .......... ...... 86
10.5 Updat i ng a model .......... .......... .......... .......... .......... .......... .......... .......... ...... 87
Appendi ces ......... .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 88
I . Dat a seri es refer ence.. .......... .......... .......... .......... .......... .......... .......... .......... ...... 89
I .1 Securi t y dat a seri es ......... .......... .......... .......... .......... .......... .......... .......... ...... 89
I .2 Agent -based Model dat a seri es.... .......... .......... .......... .......... .......... .......... ...... 93
I .3 Tradi ng Syst em dat a seri es ........ .......... .......... .......... .......... .......... .......... ..... 108
I I . Command line synt ax .......... .......... .......... .......... .......... .......... .......... .......... ..... 116
I I I . Genet i c programmi ng i n Adapt i ve Model er .......... .......... .......... .......... .......... ..... 117
I I I .1 Gener al int roduction to genet i c programming . .......... .......... .......... .......... ..... 117
I I I .2 Genet i c programmi ng in Adapt i ve Model er ..... .......... .......... .......... .......... ..... 118

4
Ful l Cont ent s:

1. I nt roduct i on .... .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 11
1.1 Agent - based model s and fi nanci al market s ...... .......... .......... .......... .......... ...... 11
1.2 How Adapti ve Model er uses agent - based model s ........ .......... .......... .......... ...... 11
1.3 Adapt i ve Model ers possi bili ti es... .......... .......... .......... .......... .......... .......... ...... 11
1.4 Speci fi cat i ons ....... .......... .......... .......... .......... .......... .......... .......... .......... ...... 13
1.5 Syst em r equi rement s ...... .......... .......... .......... .......... .......... .......... .......... ...... 13
1.6 I nst all at ion .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 14
1.7 Conventions and t ermi nology ..... .......... .......... .......... .......... .......... .......... ...... 14
1.7.1 Securi ti es and shar es ..... .......... .......... .......... .......... .......... .......... ...... 14
1.7.2 Market dat a ... .......... .......... .......... .......... .......... .......... .......... .......... ...... 14
1.7.3 Currency ....... .......... .......... .......... .......... .......... .......... .......... .......... ...... 14
1.7.4 Dat es .. .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 14
1.8 How t o use t hi s Users Gui de? .... .......... .......... .......... .......... .......... .......... ...... 15
1.9 Get t i ng hel p ......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 15
1.10 Exampl es. .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 15
2. Get t i ng St art ed Tut ori al ........ .......... .......... .......... .......... .......... .......... .......... ...... 16
Lesson 1: Model configurati on.......... .......... .......... .......... .......... .......... .......... ...... 16
Lesson 2: Model ini ti ali zat ion . .......... .......... .......... .......... .......... .......... .......... ...... 18
Lesson 3: Model evol uti on ..... .......... .......... .......... .......... .......... .......... .......... ...... 19
Cont roll ing Chart s ... .......... .......... .......... .......... .......... .......... .......... .......... ...... 21
Lesson 4: Agent s ....... .......... .......... .......... .......... .......... .......... .......... .......... ...... 22
Vi ewi ng agent det ai l s ........ .......... .......... .......... .......... .......... .......... .......... ...... 22
Agent chart s .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 24
Trading rul es.......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 25
Vi ewi ng t he popul ati on ...... .......... .......... .......... .......... .......... .......... .......... ...... 26
Breedi ng...... .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 28
Lesson 5: Eval uati ng forecast i ng abi li ti es .... .......... .......... .......... .......... .......... ...... 29
Lesson 6: Trading Si mul at or .. .......... .......... .......... .......... .......... .......... .......... ...... 32
Lesson 7: Creat i ng your own model s .......... .......... .......... .......... .......... .......... ...... 34
Mar ket dat a . .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 34
Model Confi gurat ion .......... .......... .......... .......... .......... .......... .......... .......... ...... 34
Model evol uti on ...... .......... .......... .......... .......... .......... .......... .......... .......... ...... 34
St yl e . .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 34
3. How does Adapt i ve Model er work? ... .......... .......... .......... .......... .......... .......... ...... 35
3.1 Agent - based Model ......... .......... .......... .......... .......... .......... .......... .......... ...... 35
3.1.1 Agent Popul ati on ...... .......... .......... .......... .......... .......... .......... .......... ...... 36
3.1.1.1 Trading rul es ..... .......... .......... .......... .......... .......... .......... .......... ...... 36
3.1.1.2 Order generat i on .......... .......... .......... .......... .......... .......... .......... ...... 36
3.1.1.3 Margi n mai nt enance ..... .......... .......... .......... .......... .......... .......... ...... 37
3.1.1.4 Defaul t management .... .......... .......... .......... .......... .......... .......... ...... 37
3.1.2 Virt ual Market .......... .......... .......... .......... .......... .......... .......... .......... ...... 37
3.1.3 Breeding........ .......... .......... .......... .......... .......... .......... .......... .......... ...... 38
3.1.3.1 Sel ect ion of parent s ...... .......... .......... .......... .......... .......... .......... ...... 38
3.1.3.2 Creat i ng off spring......... .......... .......... .......... .......... .......... .......... ...... 38
3.1.3.3 Repl aci ng agent s .......... .......... .......... .......... .......... .......... .......... ...... 39
3.1.4 Model Evolution ........ .......... .......... .......... .......... .......... .......... .......... ...... 39
3.1.4.1 Running mul t i pl e model evol utions ..... .......... .......... .......... .......... ...... 39
3.2 Trading Syst em .... .......... .......... .......... .......... .......... .......... .......... .......... ...... 39
3.2.1 Tradi ng Signal Generat or ..... .......... .......... .......... .......... .......... .......... ...... 40
3.2.2 Tradi ng Si mul at or ..... .......... .......... .......... .......... .......... .......... .......... ...... 40
3.2.3 St at i st i cal Si mul at ions ......... .......... .......... .......... .......... .......... .......... ...... 40
4. Market Dat a .... .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 42
4.1 Dat a r et ri eval ....... .......... .......... .......... .......... .......... .......... .......... .......... ...... 42
4.1.1 Requi red quot e dat a . .......... .......... .......... .......... .......... .......... .......... ...... 42
4.1.2 Opti onal quot e dat a .. .......... .......... .......... .......... .......... .......... .......... ...... 42
4.1.3 Accept ed quot e int erval s ..... .......... .......... .......... .......... .......... .......... ...... 42
4.1.4 Quot e bar t i mi ng convent ion .......... .......... .......... .......... .......... .......... ...... 43
4.1.5 Split s and di vi dends.. .......... .......... .......... .......... .......... .......... .......... ...... 43
4.1.6 Mi ssing or i rregul ar quot es... .......... .......... .......... .......... .......... .......... ...... 43
5
4.1.7 Deci mal di gi t s .......... .......... .......... .......... .......... .......... .......... .......... ...... 43
4.1.8 Quot e readi ng process ........ .......... .......... .......... .......... .......... .......... ...... 43
4.2 Quot e fil e format requi rement s... .......... .......... .......... .......... .......... .......... ...... 44
4.2.1 Quot e fil es wi t hout header ... .......... .......... .......... .......... .......... .......... ...... 44
4.2.2 Quot e fil es wi t h header ....... .......... .......... .......... .......... .......... .......... ...... 44
4.2.3 Support ed dat e format s....... .......... .......... .......... .......... .......... .......... ...... 45
4.2.4 Support ed t i me format s....... .......... .......... .......... .......... .......... .......... ...... 45
4.2.5 Del i mi t ers...... .......... .......... .......... .......... .......... .......... .......... .......... ...... 46
4.2.6 Deci mal separat or .... .......... .......... .......... .......... .......... .......... .......... ...... 46
4.2.7 Thousand separ at ors. .......... .......... .......... .......... .......... .......... .......... ...... 46
4.2.8 Column header s ....... .......... .......... .......... .......... .......... .......... .......... ...... 46
4.2.9 I nt erpret at ion of empt y fi el ds......... .......... .......... .......... .......... .......... ...... 46
4.2.10 Mi scel l aneous requi rement s ......... .......... .......... .......... .......... .......... ...... 46
5. Model confi gurat ion.... .......... .......... .......... .......... .......... .......... .......... .......... ...... 48
5.1 General paramet er s ........ .......... .......... .......... .......... .......... .......... .......... ...... 48
5.1.1 Quot e hi st ory fil e of securi t y .......... .......... .......... .......... .......... .......... ...... 48
5.1.2 Securi t y name/ descri ption ... .......... .......... .......... .......... .......... .......... ...... 48
5.1.3 Model name ... .......... .......... .......... .......... .......... .......... .......... .......... ...... 48
5.1.4 Model evolution st art dat e and t i me .......... .......... .......... .......... .......... ...... 48
5.1.5 Market Tradi ng Hours.......... .......... .......... .......... .......... .......... .......... ...... 48
5.1.5.1 Handling changes i n Market Tradi ng Hours .... .......... .......... .......... ...... 49
5.1.6 Pause model aft er creat i on .. .......... .......... .......... .......... .......... .......... ...... 50
5.2 Agent - based Model paramet er s .. .......... .......... .......... .......... .......... .......... ...... 50
5.2.1 Popul ati on Si ze......... .......... .......... .......... .......... .......... .......... .......... ...... 50
5.2.2 Agent I ni ti ali zat ion.... .......... .......... .......... .......... .......... .......... .......... ...... 50
5.2.2.1 Weal t h di st ri buti on ....... .......... .......... .......... .......... .......... .......... ...... 50
5.2.2.2 Posi ti on di st ributi on ...... .......... .......... .......... .......... .......... .......... ...... 51
5.2.3 Mini mum posi ti on uni t ......... .......... .......... .......... .......... .......... .......... ...... 52
5.2.4 Broker commi ssi on ( for agent s) ...... .......... .......... .......... .......... .......... ...... 52
5.2.5 Forecast ........ .......... .......... .......... .......... .......... .......... .......... .......... ...... 52
5.2.6 Rounding....... .......... .......... .......... .......... .......... .......... .......... .......... ...... 52
5.2.7 Random seed . .......... .......... .......... .......... .......... .......... .......... .......... ...... 53
5.3 Genome paramet ers ....... .......... .......... .......... .......... .......... .......... .......... ...... 53
5.3.1 Maxi mum genome si ze........ .......... .......... .......... .......... .......... .......... ...... 53
5.3.2 Maxi mum genome dept h ..... .......... .......... .......... .......... .......... .......... ...... 54
5.3.3 Mini mum i nit i al genome dept h ....... .......... .......... .......... .......... .......... ...... 54
5.3.4 Maxi mum ini ti al genome dept h....... .......... .......... .......... .......... .......... ...... 54
5.3.5 Genome creat i on gene sel ect i on ..... .......... .......... .......... .......... .......... ...... 54
5.3.5.1 Genome Creat i on and Mut at i on Test er .......... .......... .......... .......... ...... 54
5.3.6 Creat e uni que genomes....... .......... .......... .......... .......... .......... .......... ...... 55
5.4 Evolut ion paramet er s ...... .......... .......... .......... .......... .......... .......... .......... ...... 56
5.4.1 Breeding cycl e frequency ..... .......... .......... .......... .......... .......... .......... ...... 56
5.4.2 I ni t i al sel ect ion......... .......... .......... .......... .......... .......... .......... .......... ...... 56
5.4.3 Mini mum breedi ng age........ .......... .......... .......... .......... .......... .......... ...... 56
5.4.4 Parent sel ect i on........ .......... .......... .......... .......... .......... .......... .......... ...... 57
5.4.5 Mut at ion probabi lit y .. .......... .......... .......... .......... .......... .......... .......... ...... 57
5.5 Trading Syst em par amet er s ....... .......... .......... .......... .......... .......... .......... ...... 57
5.5.1 All ow Short Posi tions. .......... .......... .......... .......... .......... .......... .......... ...... 57
5.5.2 Signi fi cant Forecast Range... .......... .......... .......... .......... .......... .......... ...... 57
5.5.3 Gener at e Cash Si gnal when forecast i s out si de range...... .......... .......... ...... 58
5.5.4 Appl y FDA Fil t er ....... .......... .......... .......... .......... .......... .......... .......... ...... 58
5.5.5 St art Capi t al .. .......... .......... .......... .......... .......... .......... .......... .......... ...... 58
5.5.6 Enabl e Trading Si mul at or..... .......... .......... .......... .......... .......... .......... ...... 58
5.5.7 Aut o st art at bar ....... .......... .......... .......... .......... .......... .......... .......... ...... 58
5.5.8 Fi xed Broker Fee ...... .......... .......... .......... .......... .......... .......... .......... ...... 58
5.5.9 Vari abl e Broker Fee .. .......... .......... .......... .......... .......... .......... .......... ...... 58
5.5.10 Aver age bi d/ ask spr ead ..... .......... .......... .......... .......... .......... .......... ...... 58
5.5.11 Aver age sli ppage or pri ce i mprovement ... .......... .......... .......... .......... ...... 59
5.6 Savi ng and rest oring model confi gurat ions....... .......... .......... .......... .......... ...... 59
5.6.1 Def aul t configurat i on. .......... .......... .......... .......... .......... .......... .......... ...... 59
6. User I nt erface . .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 60
6
6.1 Cont rolling model evoluti on........ .......... .......... .......... .......... .......... .......... ...... 60
6.2 Dat a seri es t r ee vi ew ...... .......... .......... .......... .......... .......... .......... .......... ...... 60
6.3 Chart s ....... .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 61
6.3.1 Adding chart s. .......... .......... .......... .......... .......... .......... .......... .......... ...... 61
6.3.2 Adding dat a seri es t o an exi st i ng chart ...... .......... .......... .......... .......... ...... 61
6.3.3 Removi ng chart s ...... .......... .......... .......... .......... .......... .......... .......... ...... 61
6.3.4 Removi ng dat a seri es from a chart . .......... .......... .......... .......... .......... ...... 61
6.3.5 Scrol ling t hrough chart s ...... .......... .......... .......... .......... .......... .......... ...... 61
6.3.6 Maxi mi zing a chart .... .......... .......... .......... .......... .......... .......... .......... ...... 62
6.3.7 Dat a seri es names .... .......... .......... .......... .......... .......... .......... .......... ...... 62
6.3.8 Adding a moving aver age .... .......... .......... .......... .......... .......... .......... ...... 62
6.3.9 Adding an aut ocorrel at i on indi cat or . .......... .......... .......... .......... .......... ...... 62
6.3.10 Changi ng paramet er s ........ .......... .......... .......... .......... .......... .......... ...... 62
6.3.11 Showi ng the dat a overl ay .. .......... .......... .......... .......... .......... .......... ...... 62
6.3.12 Linking chart s......... .......... .......... .......... .......... .......... .......... .......... ...... 63
6.3.13 X-axi s for ti me seri es chart s......... .......... .......... .......... .......... .......... ...... 63
6.3.13.1 Chart period..... .......... .......... .......... .......... .......... .......... .......... ...... 63
6.3.13.2 Posi tioning and meaning of X- Gri dlines........ .......... .......... .......... ...... 64
6.3.13.3 X- axi s l abel s .... .......... .......... .......... .......... .......... .......... .......... ...... 64
6.3.14 X-axi s for di st ri bution seri es char t s ......... .......... .......... .......... .......... ...... 64
6.3.14.1 Hi st ogram bi n si ze ...... .......... .......... .......... .......... .......... .......... ...... 64
6.3.14.2 Bin range shown......... .......... .......... .......... .......... .......... .......... ...... 64
6.3.14.3 Posi tioning and meaning of X- gri dli nes and l abel s ... .......... .......... ...... 64
6.3.15 Y- axi s.......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 65
6.3.15.1 Y- axi s scali ng ... .......... .......... .......... .......... .......... .......... .......... ...... 65
6.3.15.2 Y- axi s l abel s..... .......... .......... .......... .......... .......... .......... .......... ...... 65
6.4 Current Values ..... .......... .......... .......... .......... .......... .......... .......... .......... ...... 65
6.5 Trading Si gnal s .... .......... .......... .......... .......... .......... .......... .......... .......... ...... 65
6.6 Popul at ion Window.......... .......... .......... .......... .......... .......... .......... .......... ...... 65
6.6.1 Scat t er pl ot s .. .......... .......... .......... .......... .......... .......... .......... .......... ...... 66
6.6.2 Densi t y chart s.......... .......... .......... .......... .......... .......... .......... .......... ...... 66
6.6.3 Using t he Z ( color) di mensi on ........ .......... .......... .......... .......... .......... ...... 66
6.6.4 Changing the axes ranges.... .......... .......... .......... .......... .......... .......... ...... 66
6.6.5 Changing the gri dl ine int erval s ....... .......... .......... .......... .......... .......... ...... 67
6.6.6 Showing t he dat a overl ay .... .......... .......... .......... .......... .......... .......... ...... 67
6.6.7 Showing correl at ion and regressi on. .......... .......... .......... .......... .......... ...... 67
6.6.8 Set t ing t he agent dot si ze.... .......... .......... .......... .......... .......... .......... ...... 67
6.7 Performance Overvi ew .... .......... .......... .......... .......... .......... .......... .......... ...... 67
6.7.1 Set t ings ........ .......... .......... .......... .......... .......... .......... .......... .......... ...... 67
6.7.1.1 Cal cul ati on Peri od......... .......... .......... .......... .......... .......... .......... ...... 67
6.7.1.2 Compounding Peri od ( sub period si ze) .......... .......... .......... .......... ...... 68
6.7.1.3 Ri sk Free Rat e.... .......... .......... .......... .......... .......... .......... .......... ...... 68
6.7.1.4 VaR Confidence Level .... .......... .......... .......... .......... .......... .......... ...... 68
6.7.2 St at us informat i on .... .......... .......... .......... .......... .......... .......... .......... ...... 68
6.7.3 Performance cal cul ati on....... .......... .......... .......... .......... .......... .......... ...... 68
6.7.4 Sub period i nformat i on........ .......... .......... .......... .......... .......... .......... ...... 68
6.8 Market Dept h ....... .......... .......... .......... .......... .......... .......... .......... .......... ...... 69
6.9 Agent Window...... .......... .......... .......... .......... .......... .......... .......... .......... ...... 70
6.9.1 Showing an agent s genome .......... .......... .......... .......... .......... .......... ...... 70
6.10 Logger ..... .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 70
6.11 Cust omi zi ng t he User I nt erf ace. .......... .......... .......... .......... .......... .......... ...... 71
6.11.1 Showi ng a wi ndow .. .......... .......... .......... .......... .......... .......... .......... ...... 71
6.11.2 Maxi mi zi ng a window ........ .......... .......... .......... .......... .......... .......... ...... 71
6.11.3 Hi ding or closi ng a wi ndow. .......... .......... .......... .......... .......... .......... ...... 71
6.11.4 Resi zing windows.... .......... .......... .......... .......... .......... .......... .......... ...... 71
6.11.5 Movi ng wi ndows ..... .......... .......... .......... .......... .......... .......... .......... ...... 71
6.11.6 Reorderi ng t abs ...... .......... .......... .......... .......... .......... .......... .......... ...... 71
6.11.7 Creat i ng window inst ances. .......... .......... .......... .......... .......... .......... ...... 71
6.11.8 Del et ing a window i nst ance .......... .......... .......... .......... .......... .......... ...... 72
6.11.9 Renaming a wi ndow inst ance........ .......... .......... .......... .......... .......... ...... 72
6.12 St yl es...... .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 72
7
6.12.1 Defaul t st yl e. .......... .......... .......... .......... .......... .......... .......... .......... ...... 72
6.13 Comput at i on performance i ssues ........ .......... .......... .......... .......... .......... ...... 73
7. Tradi ng. .......... .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 74
7.1 Eval uati ng forecast i ng success ... .......... .......... .......... .......... .......... .......... ...... 74
7.2 Usi ng t he Tradi ng Si mul at or ....... .......... .......... .......... .......... .......... .......... ...... 74
7.3 St at i st i cal Si mul ations ..... .......... .......... .......... .......... .......... .......... .......... ...... 75
8. More about dat a seri es ......... .......... .......... .......... .......... .......... .......... .......... ...... 76
8.1 Paramet er s .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 76
8.1.1 Cal cul ati on period..... .......... .......... .......... .......... .......... .......... .......... ...... 76
8.1.2 Cal cul ati on met hod ... .......... .......... .......... .......... .......... .......... .......... ...... 77
8.1.3 Compoundi ng period . .......... .......... .......... .......... .......... .......... .......... ...... 77
8.2 Movi ng Averages .. .......... .......... .......... .......... .......... .......... .......... .......... ...... 78
8.3 Autocorrel at ion..... .......... .......... .......... .......... .......... .......... .......... .......... ...... 78
8.4 Recomput abl e vs. non- recomput abl e dat a seri es ........ .......... .......... .......... ...... 79
8.5 Memory l i mi t at i ons ......... .......... .......... .......... .......... .......... .......... .......... ...... 79
9. Exporti ng dat a. .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 81
9.1 Export Set t i ngs..... .......... .......... .......... .......... .......... .......... .......... .......... ...... 81
9.1.1 Sel ect i ng dat a seri es t o export ....... .......... .......... .......... .......... .......... ...... 81
9.1.2 Sel ect i ng t he export fil e....... .......... .......... .......... .......... .......... .......... ...... 81
9.1.3 Export hi st ori cal values ....... .......... .......... .......... .......... .......... .......... ...... 81
9.1.4 Aut o Export ... .......... .......... .......... .......... .......... .......... .......... .......... ...... 82
9.2 Other Export i ssues......... .......... .......... .......... .......... .......... .......... .......... ...... 82
9.2.1 Adding dat a seri es t o t he sel ect ion.. .......... .......... .......... .......... .......... ...... 82
9.2.2 Removi ng dat a seri es from t he sel ect i on.... .......... .......... .......... .......... ...... 82
9.2.3 Exporti ng di st ri bution dat a seri es.... .......... .......... .......... .......... .......... ...... 82
9.2.4 St yl es . .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 82
9.2.5 At what poi nt in t he Agent - based Model cycl e are values export ed? ...... ...... 83
9.2.6 Dat e and t i me val ues i n t he export fi l e ...... .......... .......... .......... .......... ...... 83
10. Bat ch processi ng and aut omat i on... .......... .......... .......... .......... .......... .......... ...... 84
10.1 Creat i ng a bat ch process.......... .......... .......... .......... .......... .......... .......... ...... 84
10.1.1 Bat ch name.. .......... .......... .......... .......... .......... .......... .......... .......... ...... 84
10.1.2 Bat ch descri pti on .... .......... .......... .......... .......... .......... .......... .......... ...... 84
10.1.3 Quot e fil e( s) . .......... .......... .......... .......... .......... .......... .......... .......... ...... 84
10.1.4 Number of model s per securi t y ..... .......... .......... .......... .......... .......... ...... 84
10.1.5 Confi gurat ion ......... .......... .......... .......... .......... .......... .......... .......... ...... 85
10.1.6 St yl e . .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 85
10.1.7 Run numbers st art val ue.... .......... .......... .......... .......... .......... .......... ...... 85
10.1.8 Run model s unt il end of quot e fil e. .......... .......... .......... .......... .......... ...... 85
10.1.9 Run model s for a gi ven number of bars ... .......... .......... .......... .......... ...... 85
10.1.10 Export dat a at end of run . .......... .......... .......... .......... .......... .......... ...... 85
10.1.11 Save model s at end of run ......... .......... .......... .......... .......... .......... ...... 86
10.1.12 Pause model s at end of run ........ .......... .......... .......... .......... .......... ...... 86
10.1.13 Close model s at end of run......... .......... .......... .......... .......... .......... ...... 86
10.2 St art ing a bat ch.. .......... .......... .......... .......... .......... .......... .......... .......... ...... 86
10.3 Saving and opening bat ch set t i ngs...... .......... .......... .......... .......... .......... ...... 86
10.4 St art ing a bat ch from t he command line ........ .......... .......... .......... .......... ...... 86
10.5 Updat i ng a model .......... .......... .......... .......... .......... .......... .......... .......... ...... 87
Appendi ces ......... .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 88
I . Dat a seri es refer ence.. .......... .......... .......... .......... .......... .......... .......... .......... ...... 89
I .1 Securi t y dat a seri es ......... .......... .......... .......... .......... .......... .......... .......... ...... 89
I .1.1 Pri ce.... .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 89
I .1.2 Bid and Ask .... .......... .......... .......... .......... .......... .......... .......... .......... ...... 89
I .1.3 Spread. .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 89
I .1.4 Volume .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 89
I .1.5 Bar Ret urn ..... .......... .......... .......... .......... .......... .......... .......... .......... ...... 89
I .1.5.1 Ret urn ..... .......... .......... .......... .......... .......... .......... .......... .......... ...... 89
I .1.5.2 Log Ret urn ......... .......... .......... .......... .......... .......... .......... .......... ...... 89
I .1.5.3 Absolut e Ret urn .. .......... .......... .......... .......... .......... .......... .......... ...... 90
I .1.5.4 Absolut e Log Ret urn ...... .......... .......... .......... .......... .......... .......... ...... 90
I .1.5.5 Ret urn Di st ri bution ........ .......... .......... .......... .......... .......... .......... ...... 90
I .1.6 Ret urn . .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 90
8
I .1.7 Vol at ili t y ........ .......... .......... .......... .......... .......... .......... .......... .......... ...... 91
I .1.7.1 Weight ed Vol at ili t y ........ .......... .......... .......... .......... .......... .......... ...... 91
I .1.7.2 Hi st ori cal Vol atil i t y ........ .......... .......... .......... .......... .......... .......... ...... 91
I .1.8 Hurst Exponent ......... .......... .......... .......... .......... .......... .......... .......... ...... 92
I .2 Agent -based Model dat a seri es.... .......... .......... .......... .......... .......... .......... ...... 93
I .2.1 Bars processed ......... .......... .......... .......... .......... .......... .......... .......... ...... 93
I .2.2 Orderbook ...... .......... .......... .......... .......... .......... .......... .......... .......... ...... 93
I .2.2.1 Buy Orders......... .......... .......... .......... .......... .......... .......... .......... ...... 93
I .2.2.2 Sell Orders ......... .......... .......... .......... .......... .......... .......... .......... ...... 93
I .2.2.3 Buy Orders remai ning.... .......... .......... .......... .......... .......... .......... ...... 93
I .2.2.4 Sell Orders remai ni ng .... .......... .......... .......... .......... .......... .......... ...... 93
I .2.3 Pri ce.... .......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 93
I .2.3.1 VM Pri ce .. .......... .......... .......... .......... .......... .......... .......... .......... ...... 93
I .2.3.2 VM Bid and Ask... .......... .......... .......... .......... .......... .......... .......... ...... 94
I .2.3.3 VM Spread ......... .......... .......... .......... .......... .......... .......... .......... ...... 94
I .2.3.4 Best Agent s Pri ce .......... .......... .......... .......... .......... .......... .......... ...... 94
I .2.4 VM Volume..... .......... .......... .......... .......... .......... .......... .......... .......... ...... 94
I .2.5 VM Trades...... .......... .......... .......... .......... .......... .......... .......... .......... ...... 95
I .2.6 Bar Ret urn ..... .......... .......... .......... .......... .......... .......... .......... .......... ...... 95
I .2.7 VM Ret urn ...... .......... .......... .......... .......... .......... .......... .......... .......... ...... 95
I .2.8 VM Vol at i lit y ... .......... .......... .......... .......... .......... .......... .......... .......... ...... 95
I .2.9 Forecast ......... .......... .......... .......... .......... .......... .......... .......... .......... ...... 95
I .2.10 Forecast Accuracy ... .......... .......... .......... .......... .......... .......... .......... ...... 95
I .2.10.1 Forecast ed Pri ce Change ........ .......... .......... .......... .......... .......... ...... 95
I .2.10.2 Forecast Error ... .......... .......... .......... .......... .......... .......... .......... ...... 96
I .2.10.3 Mean Absolut e Error .... .......... .......... .......... .......... .......... .......... ...... 96
I .2.10.4 Mean Squared Error..... .......... .......... .......... .......... .......... .......... ...... 97
I .2.10.5 Root Mean Squared Error ....... .......... .......... .......... .......... .......... ...... 97
I .2.10.6 Right / Wrong Forecast ed Pri ce Changes ...... .......... .......... .......... ...... 97
I .2.10.7 Forecast Di rect i onal Accuracy . .......... .......... .......... .......... .......... ...... 97
I .2.10.8 Singl e Bar FDA.. .......... .......... .......... .......... .......... .......... .......... ...... 99
I .2.10.9 Forecast Di rect i onal Signifi cance ....... .......... .......... .......... .......... ...... 99
I .2.10.10 Forecast Di rect ional Area Under Curve ( FD AUC) ... .......... .......... ..... 100
I .2.11 Fi l t ered Vol atil i t y ..... .......... .......... .......... .......... .......... .......... .......... ..... 101
I .2.12 Popul at ion .... .......... .......... .......... .......... .......... .......... .......... .......... ..... 101
I .2.12.1 Popul at ion Si ze . .......... .......... .......... .......... .......... .......... .......... ..... 102
I .2.12.2 Average Agent Age...... .......... .......... .......... .......... .......... .......... ..... 102
I .2.12.3 Age Di st ri bution .......... .......... .......... .......... .......... .......... .......... ..... 102
I .2.12.4 Average Agent Weal t h . .......... .......... .......... .......... .......... .......... ..... 102
I .2.12.5 Weal t h Di st ri bution...... .......... .......... .......... .......... .......... .......... ..... 102
I .2.12.6 St dev Agent Weal t h ..... .......... .......... .......... .......... .......... .......... ..... 102
I .2.12.7 Popul at ion Cash .......... .......... .......... .......... .......... .......... .......... ..... 103
I .2.12.8 Popul at ion Posi ti on ...... .......... .......... .......... .......... .......... .......... ..... 103
I .2.12.9 Posi ti on Di st ri buti on..... .......... .......... .......... .......... .......... .......... ..... 103
I .2.12.10 Breedi ng fi tness r et urn di st ri bution .. .......... .......... .......... .......... ..... 103
I .2.12.11 Breedi ng fi tness excess ret urn di st ri but i on.. .......... .......... .......... ..... 103
I .2.12.12 Repl acement fi tness ret urn di st ri but i on ...... .......... .......... .......... ..... 103
I .2.12.13 Repl acement fi tness excess ret urn di st ri bution ...... .......... .......... ..... 103
I .2.12.14 Trade Durat ion Di st ri bution... .......... .......... .......... .......... .......... ..... 103
I .2.12.15 Vol ati lit y Di st ri bution.. .......... .......... .......... .......... .......... .......... ..... 104
I .2.12.16 Bet a Di st ri buti on ....... .......... .......... .......... .......... .......... .......... ..... 104
I .2.12.17 Generat ion Di st ri buti on ........ .......... .......... .......... .......... .......... ..... 104
I .2.12.18 Offspring Di st ri bution . .......... .......... .......... .......... .......... .......... ..... 104
I .2.12.19 Parent s .......... .......... .......... .......... .......... .......... .......... .......... ..... 104
I .2.12.20 Termi nat i ons... .......... .......... .......... .......... .......... .......... .......... ..... 104
I .2.12.21 Creat i ons........ .......... .......... .......... .......... .......... .......... .......... ..... 104
I .2.12.22 Defaul t s ......... .......... .......... .......... .......... .......... .......... .......... ..... 104
I .2.12.23 Margi n Call s.... .......... .......... .......... .......... .......... .......... .......... ..... 104
I .2.12.24 Genome Si ze... .......... .......... .......... .......... .......... .......... .......... ..... 104
I .2.12.25 Genome Dept h .......... .......... .......... .......... .......... .......... .......... ..... 105
I .2.12.26 Average Nodes Crossed ........ .......... .......... .......... .......... .......... ..... 105
9
I .2.12.27 Average Nodes Mut at ed........ .......... .......... .......... .......... .......... ..... 105
I .2.12.28 Mut at ions ....... .......... .......... .......... .......... .......... .......... .......... ..... 105
I .2.13 Agent . .......... .......... .......... .......... .......... .......... .......... .......... .......... ..... 105
I .2.13.1 Weal t h ... .......... .......... .......... .......... .......... .......... .......... .......... ..... 105
I .2.13.2 Posi ti on.. .......... .......... .......... .......... .......... .......... .......... .......... ..... 106
I .2.13.3 Cumul ati ve ret urn ....... .......... .......... .......... .......... .......... .......... ..... 106
I .2.13.4 Cumul ati ve excess ret urn ....... .......... .......... .......... .......... .......... ..... 106
I .2.13.5 Breeding fi t ness ret urn. .......... .......... .......... .......... .......... .......... ..... 106
I .2.13.6 Breeding fi t ness excess ret urn .......... .......... .......... .......... .......... ..... 106
I .2.13.7 Repl acement fi t ness ret urn ..... .......... .......... .......... .......... .......... ..... 106
I .2.13.8 Repl acement fi t ness excess ret urn..... .......... .......... .......... .......... ..... 107
I .2.13.9 Trade Durat i on.. .......... .......... .......... .......... .......... .......... .......... ..... 107
I .2.13.10 Vol ati lit y ......... .......... .......... .......... .......... .......... .......... .......... ..... 107
I .2.13.11 Bet a..... .......... .......... .......... .......... .......... .......... .......... .......... ..... 107
I .2.13.12 Offspring ........ .......... .......... .......... .......... .......... .......... .......... ..... 107
I .3 Tradi ng Syst em dat a seri es ........ .......... .......... .......... .......... .......... .......... ..... 108
I .3.1 Signal .. .......... .......... .......... .......... .......... .......... .......... .......... .......... ..... 108
I .3.2 Tradi ng Si mul at or ..... .......... .......... .......... .......... .......... .......... .......... ..... 108
I .3.2.1 TS Weal t h .......... .......... .......... .......... .......... .......... .......... .......... ..... 108
I .3.2.2 TS Posi ti on ......... .......... .......... .......... .......... .......... .......... .......... ..... 108
I .3.2.3 TS Trades .......... .......... .......... .......... .......... .......... .......... .......... ..... 109
I .3.2.4 TS Ret urn .......... .......... .......... .......... .......... .......... .......... .......... ..... 109
I .3.2.5 Vol at ilit y .. .......... .......... .......... .......... .......... .......... .......... .......... ..... 109
I .3.2.6 Bet a ........ .......... .......... .......... .......... .......... .......... .......... .......... ..... 109
I .3.2.7 Alpha....... .......... .......... .......... .......... .......... .......... .......... .......... ..... 110
I .3.2.8 Value at Ri sk ( VaR) ....... .......... .......... .......... .......... .......... .......... ..... 110
I .3.2.9 Rel at i ve VaR....... .......... .......... .......... .......... .......... .......... .......... ..... 111
I .3.2.10 Sharpe Rat i o..... .......... .......... .......... .......... .......... .......... .......... ..... 111
I .3.2.11 Sortino Rat io .... .......... .......... .......... .......... .......... .......... .......... ..... 111
I .3.2.12 Ri sk- adj ust ed Ret urn ... .......... .......... .......... .......... .......... .......... ..... 112
I .3.2.13 Maxi mum Drawdown ... .......... .......... .......... .......... .......... .......... ..... 112
I .3.2.14 MAR Rat io ........ .......... .......... .......... .......... .......... .......... .......... ..... 113
I .3.3 St at i st i cal Si mul at ions.......... .......... .......... .......... .......... .......... .......... ..... 113
I .3.3.1 I nt roducti on ....... .......... .......... .......... .......... .......... .......... .......... ..... 113
I .3.3.2 Hi st ori cal Si mul ati on...... .......... .......... .......... .......... .......... .......... ..... 114
I .3.3.3 Mont e Carlo Si mul ati on.. .......... .......... .......... .......... .......... .......... ..... 114
I I . Command line synt ax .......... .......... .......... .......... .......... .......... .......... .......... ..... 116
I I I . Genet i c programmi ng i n Adapt i ve Model er .......... .......... .......... .......... .......... ..... 117
I I I .1 Gener al int roduction to genet i c programming . .......... .......... .......... .......... ..... 117
I I I .2 Genet i c programmi ng in Adapt i ve Model er ..... .......... .......... .......... .......... ..... 118
I I I .2.1 Di fferences bet ween Adapt i ve Model er and convent ional GP..... .......... ..... 118
I I I .2.2 I nput of t he t radi ng rul es... .......... .......... .......... .......... .......... .......... ..... 118
I I I .2.3 Out put of t he t radi ng rul es. .......... .......... .......... .......... .......... .......... ..... 118
I I I .2.4 Defined t ypes ......... .......... .......... .......... .......... .......... .......... .......... ..... 119
I I I .2.4.1 Advi ce... .......... .......... .......... .......... .......... .......... .......... .......... ..... 119
I I I .2.4.2 Posi tion . .......... .......... .......... .......... .......... .......... .......... .......... ..... 119
I I I .2.4.3 Li mi t ..... .......... .......... .......... .......... .......... .......... .......... .......... ..... 119
I I I .2.4.4 Direct i on.......... .......... .......... .......... .......... .......... .......... .......... ..... 119
I I I .2.4.5 Leverage ......... .......... .......... .......... .......... .......... .......... .......... ..... 119
I I I .2.4.6 Quot e.... .......... .......... .......... .......... .......... .......... .......... .......... ..... 119
I I I .2.4.7 Volume.. .......... .......... .......... .......... .......... .......... .......... .......... ..... 120
I I I .2.4.8 Market .. .......... .......... .......... .......... .......... .......... .......... .......... ..... 120
I I I .2.4.9 Change.. .......... .......... .......... .......... .......... .......... .......... .......... ..... 120
I I I .2.4.10 Lag ..... .......... .......... .......... .......... .......... .......... .......... .......... ..... 120
I I I .2.4.11 Bool ean ......... .......... .......... .......... .......... .......... .......... .......... ..... 120
I I I .2.5 Funct i on and t ermi nal set .. .......... .......... .......... .......... .......... .......... ..... 120
I I I .2.5.1 CurPos .. .......... .......... .......... .......... .......... .......... .......... .......... ..... 121
I I I .2.5.2 LevUni t .. .......... .......... .......... .......... .......... .......... .......... .......... ..... 121
I I I .2.5.3 Full Lev .. .......... .......... .......... .......... .......... .......... .......... .......... ..... 121
I I I .2.5.4 Rmarket , Vmar ket ...... .......... .......... .......... .......... .......... .......... ..... 121
I I I .2.5.5 Long, Short , Cash ....... .......... .......... .......... .......... .......... .......... ..... 122
10
I I I .2.5.6 Bar ....... .......... .......... .......... .......... .......... .......... .......... .......... ..... 122
I I I .2.5.7 I nvPos... .......... .......... .......... .......... .......... .......... .......... .......... ..... 122
I I I .2.5.8 RndPos.. .......... .......... .......... .......... .......... .......... .......... .......... ..... 122
I I I .2.5.9 RndLi m.. .......... .......... .......... .......... .......... .......... .......... .......... ..... 122
I I I .2.5.10 Mkt Order ....... .......... .......... .......... .......... .......... .......... .......... ..... 122
I I I .2.5.11 open, hi gh, low, close.......... .......... .......... .......... .......... .......... ..... 122
I I I .2.5.12 bid, ask ......... .......... .......... .......... .......... .......... .......... .......... ..... 122
I I I .2.5.13 aver age, mi n, max .... .......... .......... .......... .......... .......... .......... ..... 123
I I I .2.5.14 volume .......... .......... .......... .......... .......... .......... .......... .......... ..... 123
I I I .2.5.15 avgvol , mi nvol, maxvol ........ .......... .......... .......... .......... .......... ..... 123
I I I .2.5.16 > ....... .......... .......... .......... .......... .......... .......... .......... .......... ..... 123
I I I .2.5.17 change .......... .......... .......... .......... .......... .......... .......... .......... ..... 123
I I I .2.5.18 + ....... .......... .......... .......... .......... .......... .......... .......... .......... ..... 123
I I I .2.5.19 dir....... .......... .......... .......... .......... .......... .......... .......... .......... ..... 123
I I I .2.5.20 i supbar .......... .......... .......... .......... .......... .......... .......... .......... ..... 123
I I I .2.5.21 upbars. .......... .......... .......... .......... .......... .......... .......... .......... ..... 124
I I I .2.5.22 bsmi n, bsmax . .......... .......... .......... .......... .......... .......... .......... ..... 124
I I I .2.5.23 vol at ... .......... .......... .......... .......... .......... .......... .......... .......... ..... 124
I I I .2.5.24 rsi > = 80, rsi < = 20 ..... .......... .......... .......... .......... .......... .......... ..... 124
I I I .2.5.25 sk> sd, sk< sd . .......... .......... .......... .......... .......... .......... .......... ..... 124
I I I .2.5.26 ema .... .......... .......... .......... .......... .......... .......... .......... .......... ..... 124
I I I .2.5.27 mfi> = 80, mfi < = 20 ... .......... .......... .......... .......... .......... .......... ..... 124
I I I .2.5.28 pos ..... .......... .......... .......... .......... .......... .......... .......... .......... ..... 125
I I I .2.5.29 addpos .......... .......... .......... .......... .......... .......... .......... .......... ..... 125
I I I .2.5.30 li m ...... .......... .......... .......... .......... .......... .......... .......... .......... ..... 125
I I I .2.5.31 advi ce . .......... .......... .......... .......... .......... .......... .......... .......... ..... 125
I I I .2.5.32 and, or, not .... .......... .......... .......... .......... .......... .......... .......... ..... 125
I I I .2.5.33 if......... .......... .......... .......... .......... .......... .......... .......... .......... ..... 125


11
1. Introduction
Adapt i ve Model er i s an appl i cat i on f or creat i ng agent - based mar ket si mul at ion model s for
pri ce forecast i ng of real world market - t r aded securi ti es such as st ocks, ETFs or forex
currenci es.

1.1 Agent-based models and financial markets
An agent - based model i s a bot t om- up si mul at i on of t he act i ons and i nt eract i ons of
mul ti pl e aut onomous enti ti es for t he purpose of anal ysi ng the ( emergent ) effect s on a
syst em as a whol e. An agent - based model of a financi al market consi st s of a popul ati on
of agent s ( represent i ng invest ors wi th t hei r own asset s and t radi ng st rat egy) and a pri ce
di scovery mechani sm ( represent i ng a market ) .

Agent - based model s have shown t o be abl e t o simul at e compl ex syst ems such as st ock
market s bet t er t han t radi t i onal mat hemat i cal finance. Convent ional l y, financi al market s
have been st udi ed using anal yti cal mat hemat i cs based on a generali zat i on of market
part i ci pant s and ot her si mplifi cat i ons and i deal i zat i ons. However, t he behavior of financi al
market s as observed in reali t y can not be full y descri bed by such mat hemat i cal model s.
I n reali t y, mar ket pri ces are est abl i shed by a l arge di versi t y of invest ors wi t h different
deci sion making met hods and di fferent i nvest ment goal s ( such as ri sk preference and
t i me hori zon). The compl ex dynami cs of t hese het erogeneous i nvest ors and t he resul ting
pri ce format i on process requi re a si mul at ion model of mul ti pl e het erogeneous agent s and
a vi rt ual market .

Resear ch has shown t hat compl ex behavior as seen i n act ual market s can emerge from
si mul ati ons of agent s wi t h rel at i vel y si mpl e decision rul es. Furt hermore, commonl y
observed st yli zed f act s of fi nanci al ti me seri es ( such as f at t ail s in ret urn di st ri buti ons
and vol at ili t y clust eri ng) t hat have confront ed t he Effi ci ent Market Hypot hesi s, have been
reproduced i n agent - based market model s.

1.2 How Adaptive Modeler uses agent-based models
Adapt i ve Model er creat es an agent - based mar ket model for a user-sel ect ed real worl d
securi t y. The model consi st s of a popul ation of thousands of agent s each wi t h t hei r own
t echni cal t radi ng rul e and a vi rt ual market . Adapt i ve Model er t hen evol ves t hi s model
st ep by st ep whi l e feedi ng i t wi t h hi stori cal pri ces of t he securi t y. Aft er every recei ved
pri ce, t he agent s eval uat e t hei r t rading rul e and pl ace buy or sell orders on t he Virt ual
Mar ket where a cl earing pri ce i s cal cul at ed and orders ar e execut ed. Agent s and t hei r
t radi ng rul es evol ve t hrough adapt i ve genet i c programmi ng. Agent s wi th poor
performance ar e bei ng repl aced by new agent s whose t radi ng rul es are bei ng creat ed by
recombi ning and mut at i ng t radi ng rul es of agent s wi t h good performance.

Self -organi zat i on t hrough t he evolution of agent s and t he resul ting pri ce dynami cs dri ves
t he model t o l earn t o recogni ze and ant i ci pat e recurring pri ce pat t erns whil e adapt i ng t o
changing market behavi or. Model evol ution never ends. When all hi st ori cal pri ces have
been processed, t he model wai t s for new pri ce dat a t o become avail abl e and t hen
evol ves furt her. The model t hus evol ves in parall el wi t h t he real worl d market . Aft er
ever y processed pri ce t he model generat es a forecast for t he next bar ( or ti ck) based on
t he behavi or of t he Vi rtual Market . Tradi ng si gnal s are gener at ed based on t he forecast s
and t he users t r ading preferences.

1.3 Adaptive Modelers possibilities
Model s generat e t r adi ng si gnal s for a si ngl e sel ect ed securi t y. Trading si gnal s are based
on 1- bar- ahead ( or 1-t i ck- ahead) pri ce forecast s t hat are cal cul at ed aft er every r ecei ved
quot e bar ( or ti ck) . Adapt i ve Model er support s any quot e int erval rangi ng from 1
12
mil li second t o mul ti pl e days or vari abl e int erval s. The onl y li mi ti ng fact ors are t he
avail abl e quot e dat a and processi ng speed.

Adapt i ve Model er uses evoluti onary comput at i on and l earns over t i me. Thi s means t hat a
suf fi ci ent number ( several t housands) of hi st ori cal quot es of t he sel ect ed securi t y ar e
needed. Al so, onl y aft er a suffi ci ent number of quot es has been processed, any st at i st i cal
si gni fi cance can be at t ri but ed t o demonst rat ed forecast i ng success.

Adapt i ve Model er i s pri maril y desi gned for act i ve t r ading of st ocks or st ock i ndi ces (i .e.
usi ng fut ures or ETFs) wi th suffi ci ent vol atil i t y and small spreads. Ot her securi ti es such
as forex currency pai rs or commodi ti es can al so be used because i n princi pl e Adapt i ve
Model er can process any sort of ti me seri es. I n gener al however, t he vol at ilit y on t he
used quot e i nt erval must be hi gh enough t o cover t ransact i on cost s ( broker commi ssions,
spread and sli ppage) . I f not , (si mul at ed) t r adi ng performance will be poor even wi t h hi gh
forecast i ng accuracy. For inst ance i t wil l be more dif fi cult t o achi eve good performance
wi th a 1- minut e i nt erval t han wi th a dail y int erval because t he 1- minut e pri ce changes
may be t oo small to cover t ransact i on cost s. Thi s means t hat t he break- even forecast
success rat e for a 1-mi nut e i nt erval i s higher t han for a dail y int erval .

Adapt i ve Model er provi des an ext ensi ve set of out put dat a and vi suali zat ion t ool s t o
observe t he hi st ori cal evol ution of a model , i t s present behavi or and t he accuracy,
consi st ency and si gni fi cance of previ ous forecast s and t r adi ng si gnal s. Al so i t i s possi bl e
t o si mul at e t radi ng and t o proj ect t he li kel y range of ret urns under gi ven assumpt i ons.
Ext ensi ve performance anal ysi s i s avai l abl e t o st udy ri sk and ret urn measures of t he
si mul at ed t r ades. However, as for any syst em t hat ai ms t o make predi ct i ons about t he
fut ure, t here i s no guarant ee t hat any demonst r at ed forecast i ng success or t radi ng
performance will remain t he same i n t he future. Past performance or resul t s i mpli ed,
shown or ot herwi se demonst rat ed by Adapt i ve Model er cannot guarant ee fut ure
performance or resul t s. The user should be awar e of t hi s and consi der t he ri sks and
pot ent i al rewards of ever y i nvest ment or t rading deci sion on i t s own meri t s.

Trading can be si mul at ed accordi ng t o user cust omi zabl e t radi ng paramet ers such as
enabl ing/ di sabli ng short posi tions, expect ed spr ead and sli ppage, et c.

Adapt i ve Model er does not cont ain built -i n market dat a feeds nor does i t cont ain
i nt erfaces for aut omat i c order pl acement wi t h online brokers. Market dat a i s i mport ed
from ASCI I ( CSV) fi les and out put dat a such as forecast s and t radi ng si gnal s can be
export ed t o CSV fil es for furt her processi ng by ot her appli cat i ons.

13
1.4 Specifications

Some speci fi cat ions and li mi t at ions of the di fferent edi tions of Adapt i ve Model er
1
:

Feat ure Evaluat ion
Edit ion
St andard
Edit ion
Professional
Edit ion
Forecast s and t radi ng si gnal s del ayed
2
real - ti me real - ti me
Maxi mum number of agent s 2,000 10,000 100,000
Maxi mum genome si ze 4,096 4,096 4,096
Maxi mum genome dept h 20 20 unlimi t ed
3

Maxi mum bars per model 20,000 20,000 unlimi t ed
4

Maxi mum bars st ored
5
20,000 20,000 100,000
Aut o Export No No Yes
Manual Export ( max bars) 500 99,999 99,999
Bat ch Mode ( max model s) 4
6
unli mi t ed
7
unlimi t ed
7



1.5 System requirements
The mi ni mum syst em requi rement s for running Adapt i ve Model er are:
- Wi ndows 7, Vi st a, XP, 2000 or NT 4.0
- Mi crosoft .Net Framework 2. 0 or hi gher ( will aut omat i call y be i nst all ed duri ng
i nst al l at i on of Adapt i ve Model er if not present yet )
- 512Mb RAM (support s up to 20,000 agent s; for 100,000 agent s 1Gb RAM i s requi red)

Ot her requi rement s:
- ( hi st ori cal ) market dat a of t he securi t y t o be model ed

Recommended:
- mar ket dat a feeds, downloaders and/ or conversion t ool s t hat ret ri eve market dat a and
export i t t o Comma Separ at ed Val ues ( CSV) ASCI I t ext fil es
- fast CPU

For si mul t aneousl y running mul t ipl e i nst ances of Adapt i ve Model er usi ng t he same quot e
fil e t he fol lowi ng addi t ional requirement s appl y:
- for Windows 2000: SP3
- for Windows XP: SP1


1
Val ues ment i oned ar e upper l i mi t s. Act ual val ues may depend on syst em confi gurat i on such as avai l abl e
memor y and on speci fi c model par amet er s and charact eri st i cs. See al so 6.13 Comput at i on performance i ssues.
2
The Eval uat i on Edi t i on processes r ecent quot es wi t h a del ay of a f ew days and t hus del ays f or ecast s and
t radi ng si gnal s for t he fut ur e. Thi s pr event s act ual t radi ng based on t he t radi ng si gnal s. The St andar d and
Professi onal Edi ti ons do not have t hi s l i mi t at i on.
3
Onl y l i mi t ed t o maxi mum genome si ze.
4
Li mi t ed t o approxi mat el y 2 bi lli on.
5
See al so 8.5. Memor y l i mi t at i ons.
6
Ei t her t he number of quot e fi l es or t he number of model s per securi t y can be hi gher t han 1 but not bot h.
Nei t her val ue can be hi gher t han 4. When ent eri ng i nformat i on i n t he Bat ch Processi ng di al og t hese l i mi t at i ons
wi l l not be checked. When t he bat ch i s st art ed t hey wi ll be enf orced however.
7
Li mi t ed by avai l abl e memor y and syst em r esources.
14
1.6 Installation
To i nst al l Adapt i ve Model er:
1. Uninst all any previ ous inst all at i on of Adapt i ve Model er first .
2. Download Adapt i ve Model er from t he download sect i on of t he Al t reva websi t e.
3. Unzi p t he downl oaded fi l e.
4. Launch Set up.exe and follow t he inst ruct i ons on screen.
Not e: Before i nst al ling Adapt i ve Model er, t he inst all er checks i f Mi crosoft .Net 2.0 or
hi gher i s inst all ed. I f t hi s i s not t he case, Mi crosof t .Net will be downloaded from
Mi crosoft and inst all ed fi rst ( aft er your consent ) . Thi s requi res an i nt ernet connect ion and
may t ake a f ew mi nut es. Admini st rat or pri vi l eges may be requi red t o i nst al l Adapt i ve
Model er and/ or Mi crosoft .Net .

1.7 Conventions and terminology
1.7.1 Securities and shares
The t erm securi t y i s used i n Adapti ve Model er for t he fi nanci al inst rument t hat i s bei ng
forecast ed whi ch can be a st ock, ETF, forex pai r, commodi t y, bond, future or somet hing
el se. The t er m shar es in Adapt i ve Model er i s used f or securi t y uni t s and dependi ng on
t he securi t y t ype coul d refer t o st ock shar es, currency uni t s, cont ract s, et c.

1.7.2 Market data
Adapt i ve Model er accept s bot h OHLC (open/ hi gh/ l ow/ cl ose) bar s and t i ck dat a. I n ei t her
case t he t erm bar or quot e i s oft en used t o indi cat e a set of pri ces ( i . e.
open/ hi gh/ low/ cl ose or bi d/ ask/ close) t hat form one row in a quot e fil e. The t erm bar i s
al so used t o i ndi cat e t he t i me i nt erval of a single quot e bar ( t he quot e i nt erval ) or t o
i ndi cat e a processi ng st ep. The t er m cl ose i s used t o indi cat e t he cl ose pri ce i n case of
OHLC bars or t he t rade pri ce i n case of ti ck dat a.

1.7.3 Currency
Adapt i ve Model er does not use a currency symbol for money amount s. The currency of
amount s such as st art capi t al , cost s, pri ces, et c. does not need t o be speci fi ed and can
t hus be i nt erpret ed as t he base currency of your choi ce.

All money amount s i n Adapt i ve Model er are consi dered t o be of t he same currency
( except of course pri ce rel at ed dat a when modeli ng forei gn exchange pri ces and t he
quot e currency of t he currency pai r i s not t he users base currency) .

To model a non- forex securi t y t hat i s denomi nat ed in another currency t han t he users
base currency, t he securi t y pri ces need t o be convert ed t o t he base currency before
i mporting quot es, ot herwi se changes i n t he exchange r at e woul d not be account ed for.

1.7.4 Dates
By defaul t , Adapt i ve Model er uses t he US dat e conventi on ( mm/ dd/ yy) for showing dat es
on screen and for export i ng dat a t o fil es. Thi s dat e format can be changed t o t he
European dat e convent i on (dd/ mm/ yy) t hrough Opt ions from t he Tool s menu. Be
awar e t hat t hi s dat e format has no effect on i mporti ng quot es. The dat e format used in
t he quot e fil e ( see Support ed quot e fil e format s) can be di fferent t han t he dat e
convent i on used for showing dat es on screen and for exporti ng.

15
1.8 How to use this Users Guide?

A Get t i ng St art ed Tut ori al i s provi ded i n chapt er 2 for l earning t he basi cs of Adapt i ve
Model er. Chapt er 3 descri bes t he i nner worki ngs of Adapti ve Model er in more dept h. Thi s
chapt er does not necessari l y need t o be read before t he other chapt ers. Chapt er 4
expl ai ns how t o i mport market dat a i n Adapti ve Model er and t he support ed fil e format s.
Chapt er 5 descri bes i n det ail how t o configure a model and chapt er 6 descri bes t he
vari ous el ement s of Adapt i ve Model ers user int erface. Some i ssues about t radi ng are
di scussed i n chapt er 7. Chapt er s 8 t o 10 deal wi t h some advanced feat ures such as
export i ng dat a and bat ches. Addi tional informat ion i s provi ded in appendi ces.

1.9 Getting help
Adapt i ve Model er incl udes a hel p syst em t hat pr ovi des cont ext - sensi ti ve hel p in sever al
part s of t he appl i cat ion. When a hel p but t on ( ? ) i s shown i n t he t op- right corner of a
di alog box, cont ext - sensi ti ve hel p i s avail abl e. By cli cking the hel p but t on, a quest ion
mark wil l appear next t o t he mouse cursor. By cli cki ng wi th the quest i on mark on the
desi red el ement i n t he di al og box, t he rel evant sect i on of t he Users Gui de will be shown
i n a separat e Hel p window. Al t ernat i vel y, F1 can be pressed t o get hel p for t he act i ve
t ext box or cont rol .

Cont ext - sensi ti ve hel p i s avail abl e for:
- di alog boxes wi t h a ? but t on in t he t op- right corner
- t he dat a seri es t ree vi ew ( press Shi ft - F1 on a dat a seri es name)
- Edi t Dat a Seri es Par amet er s di al og boxes ( t he Hel p but t on wi ll gi ve hel p about
t he dat a seri es)
- t he Sel ect Genes di al og box ( press F1 whil e t he cursor i s in a gene or t ype cell t o
get hel p on t he gene or t ype)

I n ot her part s of t he appli cat ion, t he Users Gui de can be l aunched by cl i cking t he hel p
( ? ) but t on i n t he t ool bar or by pressi ng F1.

Not e: By pressi ng CTRL-F i n t he Hel p wi ndow, a search box wi ll appear.

1.10 Examples
The exampl es t hat ar e present ed in t he St art up wi ndow demonst rat e some of t he
possi bi li ti es of Adapt i ve Model er. Besi des t he short descri pti ons gi ven in the St art up
wi ndow, t hey ar e not expl ai ned in det ai l and may not be sel f- expl anat ory t o new users.
To st art l earni ng how to use Adapt i ve Model er, it i s recommended t o follow t he Get t i ng
St art ed Tut ori al .

Advanced user s can use t he St yl es and/ or Configurat i on fil es t hat are used by t he
exampl es for t hei r own model s. They can be found in t he St yl es and Confi gurat i on
folders. ( The exampl es t hemsel ves ar e i mpl ement ed as bat ch fil es) .
16
2. Getting Started Tutorial

Thi s t utori al covers Adapt i ve Model ers basi c concept s and feat ures. I t shows how t o
creat e and confi gure a new model , how t o foll ow i t s evoluti on wit h vari ous chart s and
i ndi cat ors, and how t o eval uat e forecast i ng abil iti es and t radi ng performance. More
advanced feat ures ar e out si de t he scope of t hi s t ut ori al and are expl ai ned el sewher e in
t hi s Users Gui de. Chapt er 1 of t he Users Gui de i s consi dered a prerequi si t e.

The S&P500 index i s used as an exampl e case. I t has been chosen for it s st ock market
i ndex l eadershi p posi tion, i t s l ong record of hi st ori cal quot es and t he exi st ence of a deep
fut ures mar ket as well as a cl osel y correl at ed and hi ghl y l iquid ETF ( SPY) . A quot e fil e
cont ai ning t he hi stori cal dai l y quot es of t he S&P500 cash index si nce 1950 i s incl uded
8
.

Not e: The scr een shot s show what you need t o do, not t he resul t s. I n some cases your
scr een may look sli ghtl y di fferent t han t he screen shot s due t o versi on differences.

Lesson 1: Model configuration
To creat e a new model in Adapt i ve Model er:

St art Adapt i ve Model er

Cl i ck New i n t he St art up wi ndow

The New Model di al og box will open, showing the Gener al t ab. The fi rst t hing to do i s
t o sel ect t he quot e fil e of t he securi t y t hat we are going t o model . I n t hi s case we will use
t he i ncl uded S&P500 i ndex quot e fil e.

At Quot e fi l e of securi t y , cli ck t he Browse but t on




I n t he Browse di alog box, open S&P500 ( Day) .csv ( i n t he Sampl es folder)

The quot e fil e i s now preprocessed t o aut omat i cal l y det ect t he quot e int erval and some
ot her set t ings. Not e t hat t he Model evoluti on st art dat e/ t i me i s aut omat i call y set near
t he st ar t of t he quot e fil e.


Near t he bot t om of t he di alog box, check Pause model aft er cr eat i on


8
To keep t hi ngs si mpl e, S&P500 i ndex cash pri ces are used her e i nst ead of fut ur es or ETF pri ces. Not e t hat
much more hi st or i cal dai l y quot es exi st for t he S&P500 cash i ndex t han for SPY, whi ch i s useful f or model
evol ut i on. Not e t hat t he i ncl uded quot e fi l e does not cont ai n open, hi gh and l ow pri ces befor e 1962. They have
t her efor e been set equal t o t he cl osi ng pr i ce.
17



Thi s wi ll allow us t o observe t he model s ini ti al st at e before st ar t ing model evol ution.


Sel ect t he Model t ab




The Model t ab cont ai ns various par amet er s whi ch we wi ll l eave at t hei r defaul t val ues.
Not e t hat t he popul ati on will cont ain 2000 agent s. We wi ll al so l eave t he t abs Genomes
and Evolution unchanged.


Sel ect t he Tradi ng Syst em t ab




I n t he t op-l ef t you wi ll see t hat Al low short posit i ons i s checked by def aul t . Thi s means
t hat l ong, short and cash posi tions can be advi sed ( versus onl y long and cash posi t ions) .
I n t he Trading Si mul at or area, not e t hat Aut o st art at bar i s checked and t hat t he t ext
box cont ains 2500 . Thi s means t hat t he buil t -in t radi ng si mul at or will st art t radi ng
aut omat i cal l y aft er 2500 quot e bars ( t he fi rst 2500 bars can be consi dered a t rai ning
peri od in t hi s case) . We will l eave t hese set t i ngs as t hey ar e.

I n t he Broker commi ssion, spread and sli ppage area we need t o ent er reali sti c
t ransact i on cost s for t he Tradi ng Simul at or. For SPY t he spread i s usuall y 1 cent whi ch i s
about 0.01% of i t s val ue.

At Average bi d/ ask spread % , ent er 0.01

18



We will l eave t he ot her val ues unchanged. Thi s concl udes our model s configurat ion.

Lesson 2: Model initialization
You are about t o creat e and i ni ti ali ze t he model :

Cl i ck t he Creat e Model but t on of t he New model di alog box

Aft er cli cki ng Creat e Model t he model will be creat ed and i ni ti al i zed. I n t hi s case, a
popul ation of 2000 agent s i s creat ed and each agent i s gi ven a random t rading rul e, a
st art i ng capi t al of 100,000 in cash and no shares ( shar es in t hi s case ar e fi cti tious
S&P500 index shar es) . Model i ni ti ali zat ion t akes onl y a short ti me and i s onl y vi sual i zed
by a progress bar.

When model ini ti ali zat ion i s compl et e, t he fol lowi ng windows have appear ed:
- Dat a Series: an expandabl e t ree vi ew wi t h al l of Adapt i ve Model ers dat a seri es
( more about t hi s l at er)
- Current Values: some val ues at t he current point in model evol ut ion ( such as t he
number of bars t hat have been processed whi ch i s st il l zero now)
- Trading Signals: a li st of recent t r adi ng si gnal s ( st i ll empt y now)
- Chart s: several chart s such as t he S&P500 i ndex pri ce ( most chart s are st ill empt y
now)

Thi s i s the defaul t st yl e of Adapt i ve Model er. A st yl e i s a workspace l ayout t hat includes
vari ous present at i on set t i ngs and preferences. For now however, we ar e goi ng t o use
anot her st yl e t hat was speci fi call y desi gned for t hi s t ut ori al :

From t he Fi l e menu, choose Appl y St yl e




19
I n t he Open di al og box, open Tut ori al . aps ( in t he St yl es f older)

The workspace has now been changed. The Chart s window i s now call ed Model and
cont ai ns some ot her chart s.

Tip: You can di sabl e t he Tool Ti ps t hat keep poppi ng up when you move t he mouse
across t he scr een by going t o t he Tool s menu, sel ect Opt i ons and uncheck
Show User I nt erface Tool Ti ps .

Let s t ake a bri ef l ook at t he i ni ti al st at e of t he model before st art i ng model evol ution.

As sai d, all agent s own 100,000 i n cash and 0 shares. Thi s i s vi si bl e in the Weal t h
Di st ri bution hi st ogram chart in t he t op-l ef t of t he Model wi ndow. Thi s hi st ogram i s now
showing a singl e bar represent i ng 2000 agent s t hat all have a weal t h of 100,000.

Because all agent s have 0 shares at t hi s point , their posi tion i s 0%. Thi s i s shown in t he
Posi tion Di st ri bution hi stogram char t ( t op- cent er) . The posi ti on of an agent i s t he val ue
of the shar es i t owns as a per cent age of i t s weal t h. A negat i ve val ue i ndi cat es a short
posi ti on.

The t op- right chart i s a Genome Si ze Di st ri bution hi st ogram. Genomes ar e t he t r adi ng
rul es of agent s. The chart al ready shows t hat agent s have t r ading rul es of di fferent si ze.
The si ze i s measured in t he number of genes t hat t he genome consi st s of. Genes are
t he el ement ar y functi ons and val ues t hat t r adi ng rul es are const ruct ed of. The aver age
genome si ze i s shown in yellow on t he X- axi s. Lat er we will look at i ndi vi dual agent s and
t hei r t rading rul es i n more det ail .

Since you wil l be usi ng t hi s model throughout t he rest of t hi s t utori al , i t i s a good idea t o
save i t now in case you need t o revert t o t hi s poi nt l at er.

Sel ect Save from t he Fil e menu and save t he model at a l ocat i on of your choi ce

Now t hat we are f amil i ar wi th t he i ni ti al st at e of t he model , we are ready t o st art model
evol ution.

Lesson 3: Model evolution
The model i s ready t o st art i t s evolution. During evol uti on t he model wil l process t he
hi st ori cal quot es in t he quot e fil e as li ve st r eami ng dat a. Every quot e bar i s processed
onl y once and in chronol ogi cal order. ( Model evolution doesnt end when t he quot e fi l e
ends or when present day i s reached. I t continues when new quot es are added t o t he
quot e fi l e and t here i s no di fference bet ween t he way hi st ori cal and new quot es ar e
processed) .

We will fi rst go t hrough model evol ution st ep by st ep, feedi ng i t one quot e bar at a t i me:

I n t he t oolbar, cli ck t he st ep but t on (or press F4)




The model now evol ves one st ep, st ar t ing at t he Model evol uti on st art dat e/ t i me as
speci fi ed in the model confi gurat i on. At ever y st ep a quot e bar i s read from t he quot e
20
fil e
9
and all agent s eval uat e t hei r t rading rul e and pl ace a buy or sel l order on t he Vi rtual
Mar ket . The Vi rt ual Market ( VM ) cal cul at es t he cl eari ng pri ce and execut es all
execut abl e orders. The cl eari ng pri ce ( VM Pri ce ) i s t hen t aken as t he forecast for t he
close of t he next bar and a new t radi ng si gnal i s gi ven i f necessar y. Thi s process i s
repeat ed for every i mport ed quot e bar. A st ep usual l y t akes onl y a fract i on of a second.

Let s see what exact l y has changed aft er t hi s first st ep. The fi rst val ues have appear ed in
t he char t s Buy Orders, Sel l Orders, VM Trades , VM Vol ume and VM Pri ce . These
refl ect t he numbers of buy and sell orders t hat have been pl aced, t he resul ting t rades
and t he cl eari ng pri ce. More det ail ed market i nformat i on such as mar ket dept h i s al so
avail abl e but t o keep t hi ngs si mpl e t hi s i s not covered in t hi s tut ori al .

The Weal t h Di st ributi on and Posi tion Di st ri buti on hi st ograms now show different
weal t h and posi tion val ues for agent s as a resul t of changes i n t hei r port folios.

The forecast ( whi ch equal s t he VM Pri ce) i s shown i n the Current Values window and al so
drawn i n t he bot t om-ri ght chart (i n red) . Thi s chart al so shows t he securi t ys pri ce i n
yel l ow (t he S&P500 index in t hi s case) . A t radi ng si gnal has been gener at ed dependi ng
on whet her t he forecast i s above or below t he l ast securi t y pri ce and i s shown in t he
Trading Si gnal s window. The t radi ng si gnal i s al so drawn in t he bot t om- right chart (i n
whi t e) as an up or down arrow for Long or Short si gnal s or a smal l ci rcl e for Cash
si gnal s
10
.

Not e: Depending on avail abl e space, t he securi t y pri ce i s shown in t he chart as cl ose
li nes or as OHLC pri ce bars.

Tip: You can maxi mi ze a chart or enti re window t o get a bet t er vi ew by cl i cki ng t he
maxi mi ze but t on near i t s t op-ri ght corner. Maxi mi zed char t s or wi ndows can be
de- maxi mi zed wi t h the de- maxi mi ze but t on. Dependi ng on your screen si ze, you
may want t o maxi mi ze a char t or window at some point s duri ng t hi s t ut ori al .


Press F4 ( or cli ck t he st ep but t on) some more ti mes whil e observi ng the chart s

You will see t he Vi rt ual Market act i vi t y unfol d furt her as new orders ar e pl aced by agent s.
The number of buy and sel l orders and t rades vari es per bar. At every st ep a f orecast for
t he next bars cl osi ng pri ce i s made. New t r adi ng si gnal s wi ll be gi ven when necessary.
Because Adapt i ve Model er makes a bar- ahead forecast every bar ( at t empt i ng t o predi ct
t he direct i on of bar- t o-bar pri ce changes) new signal s are somet i mes gi ven al most ever y
bar.

Model evol uti on can al so proceed cont i nuousl y. Use t he resume and pause
but t ons t o resume/ pause model evoluti on. You can al so use t he F3 key t o resume/ pause
model evol ution.

Press F3 a coupl e of ti mes t o resume and pause model evolution

We will now l et t he model evol ve until about 1000 bars. You can see how many bar s
have been processed in t he Current Val ues wi ndow. Use pause/ resume ( F3) or st ep ( F4)
at wil l . Take your ti me and observe t he chart s.

Evol ve t he model unt il about 1000 bars have been processed and t hen pause i t
agai n


9
Act ual l y, t he fi rst st ep i s onl y a part i al st ep. No new bar i s read from t he quot e fi l e yet si nce t he bars befor e
model st art dat e ar e al ready i n memory. The cl osi ng pr i ce of t he model st art bar wi l l be for ecast ed but t he
Bar s pr ocessed count er wi l l st ay at 0.
10
The hori zont al posi t i on of f orecast s and si gnal s i n t he chart i s at t he next bar. The vert i cal posi t i on of si gnal s
i s at t he l ast securi t y cl osi ng pri ce.
21
Not e: Especi all y during the earl y ( l earni ng) st ages of model evol ution, forecast s
somet i mes st rongl y di verge from t he securi t y pri ce. Lat er t he f orecast s usual l y t end
t o st ay cl oser t o t he securi t y pri ce. Therefore, t he Tradi ng Si mul at or i s usuall y st art ed
af t er a l earni ng period of a number of bars. Adapt i ve Model er al so offers ways t o fil t er
out st rongl y di verging forecast s ( see Si gnifi cant Forecast Range) .

You may have not i ced t hat aft er 80 bars t he Genome Si ze Di st ri buti on al so st art ed t o
change. Thi s i s caused by r epl acement of agent s and t heir t rading rul es by new agent s
t hrough breedi ng. We wil l deal more wi t h thi s l at er.

Al so not e t hat t he Popul at i on Posi tion chart ( bot t om-cent er) shows t he course of t he
aver age posi ti on of all agent s over t i me.

Not e: I n case you fail ed t o pause t he model around 1000 bars and t he model has
al ready evol ved much furt her, you can revert t o t he model saved at t he end of
Lesson 2 and t ry agai n i n order t o keep t he model in sync wi t h t hi s t utori al . Savi ng
t he model at t he end of every l esson i s recommended for revert i ng when needed.

Controlling Charts
Because ol der informat i on di sappears from t he left si de of chart s during evol ution, t he
chart s are now onl y showing the l ast quart er of hi st ory. Thi s i s indi cat ed i n t he Chart
peri od dropdown box in t he mai n t oolbar whi ch shows Quart er . You can change t he
chart period t o vi ew l onger peri ods:

I n t he mai n toolbar, cli ck on the Chart peri od dropdown box and sel ect Year




All t he chart s ( except t he di st ri bution hi stograms) will now show one year of hi st ory.

I n Chart period dropdown box, sel ect 5 year s

Now all the model s evol ution hi story so far shoul d be vi si bl e.

I n Chart period dropdown box, sel ect Quart er agai n

To l ook back at ol der informat i on wi thout zooming out and losing det ail s, you can si mpl y
scroll t he chart s hori zont all y:

On t he VM Pri ce chart s pl ot area, cl i ck and hold down t he l eft mouse but t on and
drag t he chart t o t he ri ght to see i t s hi st ory

22



When you do t hi s, all t he chart s wi ll scroll in sync ( except t he di st ri buti on hi st ograms) .
When you are done vi ewi ng t he hi story:

Drag t he chart back t o i t s most recent val ue again ( or cli ck t he > but t on near t he
t op- ri ght corner t o j ump there di rect l y)




Not e: A chart must be showing i t s most recent val ue i n order t o scroll aut omat i cal l y
during model evol ution. ( When t he most recent value i s shown, t he < and > but t ons
ar e not shown) . To l earn more about usi ng chart s, see Char t s.

Lesson 4: Agents
I n an agent - based model t he most int erest i ng phenomena ar e gener al l y seen on t he
popul ation l evel rat her t han in i ndi vi dual agent s. The purpose of an agent -based model i s
t o st udy emergent behavi or caused by t he i nt eract i on of many (rel at i vel y si mpl e) agent s.
Li kewi se, we are more i nt erest ed i n t he forecast s ( Vi rt ual Market pri ces) t hat r esul t from
our model t han in t he li fe and ti mes of indi vi dual agent s.

However, i t i s i mport ant t o know what agent s are and how t hey operat e and int eract t o
underst and how t hey influence t hei r envi ronment ( t he market ) and t he forecast s. I n t hi s
l esson we wil l therefore fi rst look at t he det ail s of i ndi vi dual agent s and t hen look at t he
popul ation as a whol e agai n.

Viewing agent details
To get det ail ed informat i on of an agent :

From t he Vi ew menu, choose Agent and t hen Agent 1

23



A window ti tl ed Agent 1 has now appear ed ( bot t om- l eft ) showing t he following
i nformat ion of agent number 1:
- Age: number of bars processed si nce agent creat i on
- Cash: amount of cash owned by agent
- Shares: number of shares owned by agent ( negat i ve f or short posi tion)
- Wealt h: t ot al weal t h of an agent ( val ue of cash and shares)
- Posit ion: val ue of shares as a percent age of weal t h (negat i ve for short posi ti on)
- Cumulat ive ( excess) ret urn: ret urn si nce agent creat i on ( excess of securi t ys
ret urn)
- Breeding fitness ( excess) ret urn: a short t er m t rail ing ret urn measure (sel ect i on
cri t eri on for breeding)
- Replacement fit ness ( excess) return: aver age (excess) ret urn per bar ( sel ect i on
cri t eri on for repl acement )
- Trade duration: average number of bars bet ween t rades ( i ndi cat or of an agent s
invest ment / t r ading hori zon)
- Volat ilit y: vol at il it y of agent weal t h (indi cat or of absolut e ri sk of an agent s
invest ment / t r ading st yl e)
- Bet a: correl ati on of agent weal t h wi t h securi t y pri ce ( indi cat or of rel at i ve ri sk of an
agent s i nvest ment / t r adi ng st yl e)
- Generat ion: geneal ogi cal generat i on number of agent
- Offspring agent s: number of offspri ng agent s t hi s agent has produced
- Genome size: si ze of genome ( t radi ng rul e) i n number of genes
- Genome dept h: number of hi erarchi cal l evel s i n genome


Evol ve t he model unt il about 1300 bars (use F3 and/ or F4) and wat ch t he agent
val ues change

You may not i ce t hat Age i s somet i mes reset t o 1. Thi s means t hat t he agent has been
repl aced by a new agent in the breedi ng process. I n fact , t he Agent wi ndow shows slot s
i n t he popul at ion. Al so not e t hat some agent val ues onl y become avail abl e when t he
agent has r eached a cert ai n age.

Look at some ot her agent s by changi ng t he agent number i n t he Agent windows
t oolbar ( by t ypi ng or by usi ng t he up and down but t ons or keys)


24
Agent charts
Most agent val ues can al so be foll owed i n chart s:

Cl i ck on t he Agent s t ab ( bel ow t he chart s)




I n t hi s wi ndow, a chart wi t h the weal t h hi st ory of agent 1 i s al ready showing. We wil l add
some more chart s:

I n t he Dat a Seri es wi ndow, expand t he Agent - based Model cat egory

Expand t he Agent subcat egory




I n t he Agent subcat egory you will see various agent dat a seri es such as Agent Weal t h
and Agent Posi t ion. To wat ch t he t radi ng act i vit y of an agent :

I n t he Dat a Seri es wi ndow, doubl e- cl i ck on t he Agent Posi tion dat a seri es name




A di alog box Edi t Dat a Seri es Paramet ers wi ll appear where you can ent er t he agent
number t o show:

Ent er 1 in t he t ext box and press ENTER (or cl ick OK )

25



A new chart showing t he posi ti on hi st ory of agent 1 has now been added t o t he Agent s
wi ndow. I t doesnt cont ai n any hi st ory yet because t hi s i nformat i on i s not st ored for all
agent s. During model evolut ion new i nformat i on will appear i n t hi s chart . Wi th t hi s chart
i t i s easy t o see t he t r ades of an agent from t he changes in i t s posi tion.

You can al so show i nformat i on of mul ti pl e agent s in one chart :

From t he Dat a Seri es window, drag and drop t he Agent Weal t h dat a seri es name
into t he chart Agent Weal t h (1)




Ent er 2 in t he Edi t Dat a Seri es Paramet ers and press ENTER

The weal t h hi story of agent 1 and agent 2 are now shown t oget her i n one chart .

From t he Dat a Seri es window, drag and drop Agent Posi ti on i nt o t he Agent
Posi tion (1) chart , ent er 2 in the di al og box and press ENTER

The posi tion hi st ory of agent 1 and agent 2 are now shown t oget her i n one chart .


Evol ve t he model unt il about 2000 bars and wat ch t he agent chart s

You may not i ce dot s appeari ng in t he agent char t s occasi onall y. Thi s indi cat es agent
repl acement .

Tip: You can show any dat a seri es from t he Dat a Seri es wi ndow in a chart in the
ways shown above. Up t o ei ght dat a seri es can be combi ned in one chart .

Trading rules
From t he Agent window, you can al so vi ew an agent s t radi ng rul e.

I n t he Agent windows t ool bar, cl i ck t he Show genome but t on

26



A window wi ll appear showing t he agent s t r ading rul e. Expl aini ng t he t radi ng rul es i s
out si de t he scope of t hi s t ut ori al . To l earn more, see Showi ng an agent s genome or
Trading Rul es.

When you are done vi ewing t he t radi ng rul e, close t he t r ading rul e wi ndow

Cl ose t he Agent wi ndow by cli cki ng t he x but t on in i t s t op-ri ght corner




Viewing the population
You are al ready famil i ar wi t h t he weal t h and posi t ion di st ri but ion hi st ogram chart s. These
chart s gi ve onl y a gli mpse of t he di versi t y of agent s. A more ext ensi ve vi suali zat i on of
t he agent popul ati on i s provided by t he Popul at ion window where mul ti pl e agent values
can be plot t ed agai nst each ot her.

Cl i ck on t he Popul at ion t ab ( bel ow t he chart s)




The Popul at ion window i s now showi ng and contai ns a scat t er pl ot of agent Weal t h
agai nst agent Age. As i s shown in t he t oolbar, Age i s shown on t he X- axi s and Weal t h on
t he Y- axi s. Ever y dot represent s one agent .


I n t he Popul ati on windows t ool bar, cli ck t he Show Correl at ion and Regressi on
but t on




27
Correl at i on and regressi on informat i on will appear and a r egression l ine i s drawn. I n
gener al , t here will be a posi ti ve correl at i on bet ween Age and Weal t h because
evol utionary sel ect i on pressure wi ll l et successful agent s st ay i n t he popul ation longer
t han unsuccessful ones.


I n t he Popul ati on windows t ool bar, cli ck on t he Z ( color): dropdown box and
sel ect Posi tion




The color of t he agent s now i ndi cat es t hei r posi tion; bl ue for l ong posi tions and red for
short posi tions ( see t he l egend above t he plot area) . Duri ng model evolut i on you wi ll
noti ce agent s changi ng color. Some agent s ar e holding a long posi t ion most of t he t i me,
ot hers a short posi tion and others frequent l y swit ch posi ti ons.

Evol ve t he model unt il about 2500 bars whil e wat ching t he Popul ation window


Let s l ook at some ot her agent val ues:

I n t he Popul ati on windows t ool bar, cli ck on t he X: dropdown box and sel ect
Trade Durat ion

Cl i ck t he Show Correl at i on and Regressi on but t on agai n to remove correl at ion
and regressi on informat ion





Agent Weal t h i s now plot t ed agai nst Trade Durat ion. Agent s wi t h low t rade durat i on
( act i ve t r aders ) ar e on t he l eft and t hose wi t h hi gh t rade durat i on ( long t erm
i nvest ors ) are on t he ri ght .

Evol ve t he model unt il about 3000 bars and wat ch t he Popul ation window

28
You may not i ce t hat some agent s ar e movi ng t o t he ri ght as t hei r t rade durat i on
i ncreases wi t h ti me ( l ong t erm invest ors ) and ot hers ar e st ayi ng on t he l eft whil e
frequent l y changing thei r Posi tion, as i s indi cat ed by col or changes ( act i ve t r ader s ) .

Hundreds of di fferent scat t er plot s can be made from all t he possi bl e combinat i ons of
agent val ues. A qui ck way t o see some of t hem is t o browse t hrough t he X: , Y: or
Z: dropdown boxes. To ensure t hat t he most rel evant regi on of t he plot i s aut omat i call y
shown for ever y combi nat i on, t he axes ranges can aut omat i call y be set t o a number of
st andard devi at i ons around t he mean val ue:

I n t he Popul ati on windows t ool bar, cli ck t he X-Axi s set t i ngs but t on

I n t he X- axi s t oolbar t hat has j ust appear ed, cli ck on the Range: dropdown box
and sel ect st dev i nt erval s

I n t he Popul ati on windows t ool bar, cli ck t he Y-Axi s set t i ngs but t on

I n t he Y- axi s t oolbar, cl i ck on the Range: dropdown box and sel ect st dev
int erval s as wel l




I n t he Popul ati on windows t ool bar, cli ck t he X-Axi s set t i ngs and Y-Axi s
set t i ngs but t ons once more t o hide t he axi s t ool bars

Now doubl e- cli ck on any of t he X: , Y: or Z: dropdown boxes and use t he
mouse wheel ( or UP and DOWN arrow keys) t o browse t hrough different pl ot s

Evol ve t he model unt il about 6000 bars whil e browsing t hrough different pl ot s at will

Tip: An i nt erest ing plot i s Of fspring for X, Genome si ze for Y and Bet a for Z. The
hori zont al posi t ion of agent s now i ndi cat es t he t ot al number of t hei r offspring agent s
( whi ch in general correl at es st rongl y wi t h long t erm ret urn) . When an agent moves t o
t he ri ght , i t i s creat i ng offspring agent s and must t herefore be among t he agent s wi t h
hi ghest Breeding Fi t ness Ret urn ( whi ch i s a short t erm ret urn i ndi cat or). The Genome
si ze i t sel f i s not of maj or int erest here but i s used t o di st ri but e agent s vert i cal l y over
t he chart for cl ari t y. Because t he genome si ze doesnt change during an agent s l ife,
t he vert i cal posi tion st ays fi xed whi ch makes i t easy t o follow indi vidual agent s.

Breeding
Breedi ng i s t he process of creat i ng new offspring agent s from some of t he best
performi ng agent s t o repl ace some of t he worst performi ng agent s. At every bar, agent s
wi th t he highest Breedi ng Fi tness Ret urn are sel ect ed as par ent s. Copi es of t he
genomes ( t r adi ng rul es) of pai rs of t hese parent s ar e t hen recombined t hrough genet i c
crossover t o creat e new genomes t hat are gi ven t o new offspri ng agent s. These new
agent s r epl ace agent s wi t h t he lowest Repl acement Fi t ness Ret urn .

29
The breedi ng frequency and t he number of agent s t o be repl aced can be cont roll ed by
par amet er s t o i nfluence t he adapt abili t y versus t he st abili t y of the model . Changing t hese
par amet er s i s out si de t he scope of t hi s t ut ori al but we will l ook at how some of t he
consequences of t he breeding process can be observed.

Cl i ck on t he Breeding t ab ( bel ow t he Popul at ion window)




I n t he mai n toolbar, set t he Chart peri od t o 25 Years

The Creat ions chart (t op-l eft ) shows t he number of agent s cr eat ed per bar. Aft er heavy
i ni ti al fluct uat ion t hi s value st abil i zes t o 20 agent s ( 1% of t he popul at i on) per bar. ( Thi s
i s because t he number of agent s t hat can be creat ed/ r epl aced depends on agent age) . To
keep t he popul at ion si ze fi xed, t he number of repl aced agent s i s al ways equal t o t he
number of new creat ed agent s.

The Avg Agent Age chart shows t he average age of all agent s. Thi s gi ves an i ndi cat i on
of the l evel of experi ence pr esent i n t he popul ation. Sudden drops may indi cat e a sudden
change i n t he market t hat resul t ed in a wi pe- out of experi enced agent s. The Age
di st ri bution hi st ogram shows what age groups current l y exi st in t he popul ation.

The Avg Genome Si ze shows t he average si ze of the genomes over t i me. Al so recall t he
Genome Si ze Di st ri bution hi st ogram on t he Model t ab. Through the process of
recombi ning and mut at i ng genomes for t he creat i on of new agent s, t he aver age genome
si ze changes. Bi gger genomes may cont ai n more compl ex al gori thms and may be abl e t o
l ook back furt her in hi st ory but are not necessari l y al ways bet t er.

Evol ve t he model unt il t he end of t he quot e fil e whi l e observi ng t he Model , Agent s,
Popul ation or Breedi ng window at wil l ( at any Chart peri od)

Lesson 5: Evaluating forecasting abilities
So far we have looked i nsi de t he model ext ensi vel y but we have not l ooked at how wel l i t
i s doi ng what i t i s supposed t o do, t he forecast i ng of pri ces. To eval uat e t he forecast i ng
abi li ti es of a model , a number of indi cat ors are avail abl e.

Cl i ck on t he Forecast s t ab (bel ow t he mai n window)




I n t he mai n toolbar, set t he Chart peri od t o Quart er

A si mpl e but int uiti ve way t o observe past f orecast s i s provi ded by t he Ri ght Forecast ed
Pri ce Changes ( blue) and Wrong Forecast ed Pri ce Changes ( red) i n t he t op- cent er
chart . These seri es show t he securi t y pri ce using bl ue for pri ce changes whose di rect i on
was forecast ed ri ght and red for t hose t hat wer e forecast ed wrong. Thi s vi sual i zes how
many pri ce changes wer e forecast ed ri ght and wrong as wel l as t hei r magni t ude.

30
A more quant i t at i ve way t o eval uat e forecast s i s provi ded by t he FDA chart ( t op- ri ght ) .
FDA st ands for Forecast Di rect i onal Accuracy . Thi s indi cat or shows t he percent age of
bars for whi ch t he forecast ed pri ce change was in t he right direct i on. Val ues above 50%
i ndi cat e t hat more oft en t han not t he di rect ion of pri ce change was forecast ed correct l y.
The chart shows a 100 day t rail ing FDA during t he l ast quar t er.

To see how t he FDA evol ved during t he enti re model hi st ory:

I n t he mai n toolbar, set t he Chart peri od t o 100 Year s

On such l ong ti me scal es you may want t o cal culat e a t r ai ling FDA over more bar s:

Ri ght -cl i ck on t he FDA chart

I n t he cont ext menu, open t he dat a seri es submenu and cli ck Paramet er s






I n t he di alog box, ent er 1000 at Trai ling bars and cli ck OK




The chart now shows a 1000 day t rai ling FDA. You may not i ce t hat FDA vari es over t i me.
Peri ods wi t h good forecast i ng are f oll owed by peri ods wi t h poor forecast i ng and vi ce
ver sa. To get t he average FDA over t he ent i re model hi st ory:

31
I n t he Dat a Seri es wi ndow, expand t he Agent - based Model cat egory and expand
t he Forecast Accuracy subcat egory




I n t he Forecast Accuracy subcat egory, l ocat e t he FDA dat a seri es and drag and
drop it int o t he Current Values window





I n t he Edi t Dat a Seri es Paramet ers di al og box, sel ect Si nce model st art and cl i ck
OK

The FDA since model st art i s now shown in t he Current Val ues wi ndow.
32

Tip: You can show any dat a seri es from t he Dat a Seri es wi ndow in the Current Val ues
window, in t he way shown above.

For a more compl et e eval uat ion of forecast i ng abi li ti es, ot her i ndi cat ors in t he Forecast
Accuracy cat egory shoul d be observed as well . Thi s i s out si de t he scope of t hi s tut ori al .

Tip: To l earn more about any dat a seri es in t he Dat a Seri es wi ndow, cli ck on (or
sel ect ) t he dat a seri es name and press Shi ft - F1.

To conclude whet her or not a model wi th forecast i ng abil iti es will be useful for t radi ng,
t he performance of t rades based on t he t radi ng si gnal s needs t o be eval uat ed. Thi s
performance does not onl y depend on forecast i ng abili ti es but al so on vol ati lit y and
t ransact i on cost s. I n t he next l esson we wi ll see how t o eval uat e performance wi t h t he
Trading Si mul at or.

Lesson 6: Trading Simulator
The Tradi ng Si mul at or si mul at es t r adi ng based on t he t radi ng si gnal s and your personal
t radi ng pref erences and i s used t o cal cul at e ret urns and ot her performance i ndi cat ors.

Cl i ck on t he Forecast s t ab and set t he Chart peri od t o 100 Year s

The TS Weal t h chart (mi ddl e-l eft ) shows t he Tradi ng Si mul at or Weal t h
11
. To get i t s
exact current val ue:

Cl i ck on t he dat a seri es name ( TS Weal t h ) above t he char t




A dat a overl ay wi ll be shown on the chart wi t h the value at t he current bar.

Tip: You can get a dat a overl ay for any dat a ser i es in a chart by cli cki ng on it s name
above t he chart . Cli ck once more t o hi de i t again. To l earn more, see dat a overl ay.

At model creat i on, Trading Si mul at or Weal t h st art s wi t h t he St art Capi t al as speci fi ed on
t he Tradi ng Syst em t ab of t he model paramet ers (100,000) . Whil e the Trading
Si mul at or i s enabl ed, i t si mul at es t r ades accordi ng t o t he si gnal s. I t s weal t h i s adj ust ed
accordingl y, t aki ng into account t he broker commi ssi on, spread and sli ppage set t i ngs as
speci fi ed on t he Trading Syst em t ab. Recall from l esson 1 t hat t he Tradi ng Si mul at or
was set t o st art t r ading aut omat i call y aft er 2500 bars ( around 1960) .

Tip: You can manual l y enabl e or di sabl e t he Tradi ng Si mul at or during model evoluti on
wi th t he TS but t on on the mai n t oolbar. You can al so change Trading Syst em
set t i ngs and ot her model paramet ers duri ng model evoluti on (cl i ck t he Edi t Model
par amet er s but t on on t he mai n t ool bar) .


11
Adapt i ve Model er uses sci ent i fi c not at i on t o show ver y l arge or smal l val ues ( i .e. 1. 00E+ 06 i s 1 mi l li on) .
33
The mi ddl e- cent er chart shows a 1 year t r aili ng ret urn of t he securi t y (in yellow) t oget her
wi th a 1 year t r ai ling ret urn of t he Trading Si mulat or (i n red). The mi ddl e- right chart
shows t he excess 1 year t rail ing ret urn of t he Tradi ng Si mul at or over t he securi t y
12
.

The bot t om-l ef t chart shows t he hi st ori cal vol at ili t y of t he securi t y (in yellow) wi th t he
hi st ori cal vol atil i t y of Tradi ng Si mul at or weal t h (in red) . The vol atili t y of Tradi ng
Si mul at or weal t h i s oft en lower t han t hat of t he securi t y because t he al t ernat i on of long,
short and cash posi tions t ends t o t emper vol at ilit y.

The bot t om- cent er and bot t om- ri ght chart s show t he Trading Si mul at or posi ti on and i t s
number of t rades per day
13
. On a peri od of 100 year s t hese chart s are not very cl ear. We
wi ll t herefore add moving aver ages:

Ri ght -cl i ck on t he TS Posi tion chart

I n t he cont ext menu, open t he submenu for t he dat a seri es and cli ck Add movi ng
aver age

I n t he Edi t Dat a Seri es Paramet ers di al og box ent er 1000 at Bars and cl i ck
OK

A 1000 day moving average of t he Tradi ng Si mul at or posi ti on has now been added t o t he
chart ( i n red).

I n t he same way, add a 1000 day movi ng average t o t he TS Trades chart

Tip: You can add movi ng aver ages t o most char t s.

An overvi ew of t he Tradi ng Si mul at ors performance wi t h vari ous ri sk and ret urn
i ndi cat ors i s provi ded by t he Performance Over vi ew:

Cl i ck on t he Performance t ab (bel ow t he Model wi ndow)




The Performance Over vi ew i s now showi ng. You can change t he cal cul at i on period and
some ot her set t i ngs by cl i cki ng on the Performance Cal cul ati on Set t i ngs but t on
above t he Performance Over vi ew. To l earn more, see Performance Overvi ew.

Not e: Model evol ution, forecast ing abili ti es and performance depend i n part on
random fact ors t hat are i nherent t o agent - based modeling and genet i c programmi ng.
The model creat ed i n t hi s t ut ori al will t heref ore be diff erent ever y t i me i t i s creat ed.
I n general i t i s recommended t o do mul tipl e runs wi t h t he same model paramet er s for
a more compl et e overvi ew of possi bl e resul t s.

Tip: For a more ext ensi ve anal ysi s of the pot ent i al range of ret urns under varying
condi tions based on assumed val ues of FDA and vol at il it y, t he St at i st i cal Si mul ations
can be used.


12
Al l ret urn and performance i ndi cat ors i n Adapt i ve Model er ar e cal cul at ed aft er al l t ransact i on cost s ( broker
commi ssi ons, spr ead and sl i ppage) .
13
Swi t chi ng fr om a l ong t o a short posi t i on or vi ce versa i s count ed as t wo t rades.
34
Lesson 7: Creating your own models
Thi s t utori al concludes wi t h some gui delines for creat i ng your own model s. When creat i ng
your own model s, a few t hings will usuall y be different t han as shown in thi s t ut ori al .

Market data
Mar ket dat a needs t o be provi ded and may need t o be convert ed t o one of Adapt i ve
Model ers support ed format s. See 4. Market dat a for more informat i on about t hi s.

Model Configuration
At l east t he following model paramet er s shoul d be checked/ adj ust ed t o correspond wi t h
t he securi t y you are model ing and your preferences ( more about model confi gurat i on i s
expl ai ned i n 5. Model confi gurati on) :

On t he General t ab:
- Aft er sel ect ing a quot e fil e, t he Model evol uti on st art dat e/ t i me will
aut omat i cal l y be set at t he earli est possi bl e st ar t t i me ( a cert ai n number of bars
aft er t he first quot e in t he quot e fil e) . I t i s possibl e t o set t he st art dat e/ t i me at a
l at er dat e/ t i me.
- Verify t hat t he Market Tr ading Hours mat ch t he act ual t rading hours of t he
securi t y and correct t hem if necessar y.

On t he Model t ab:
- Under Rounding, make sure t hat t he number of deci mal di gi t s and mi ni mum pri ce
i ncrement uni t are correct .

I n t he Gene Sel ect ion :
- Enabl e/ di sabl e t he open, high, low, bi d, ask genes dependi ng on whi ch dat a i s
i ncluded in t he quot e fil e and whet her or not agent s should see i t .
- Enabl e/ di sabl e vol ume rel at ed genes depending on whet her or not volume dat a i s
i ncluded in t he quot e fil e and agent s shoul d see i t .

On t he Trading Syst em t ab:
- Check or uncheck Al low short posi tions and other t radi ng si gnal generat i on
set t i ngs as desi red.
- Ent er a St art Capi t al for t he Tradi ng Si mul at or.
- Ent er t he correct broker commi ssi ons, spread and sli ppage val ues for t he securi t y.

Model evolution
By defaul t , t he Pause model at st art opti on i s di sabl ed so model evol ution follows
i mmedi at el y aft er i ni ti ali zat ion. Oft en you may want t o evol ve a model first unt il present
day wi t hout int erruptions and t hen anal yze t he resul t s aft erwards ( al so see Comput at i on
performance i ssues) . However, i f you want t o obser ve model evol ution li ve usi ng t he
Popul ation wi ndow (or ot her dat a t hat i s not st ored hi st ori cal l y) you can use t he pause,
st ep and resume functions.

Style
The defaul t st yl e t hat Adapt i ve Model er uses i s not t he same as t he st yl e t hat was used
for t hi s t utori al and does not cont ain t he same chart s. However, you can sel ect any st yl e
t o be t he defaul t st yl e or even creat e your own defaul t st yl e. To l earn more, see St yl es.

35
3. How does Adaptive Modeler work?
Adapt i ve Model er consi st s of t wo mai n part s: t he Agent - based Model and t he Trading
Syst em. I n short , t he Agent - based Model recei ves quot es and produces pri ce forecast s
and t he Tradi ng Syst em deci des when a new t radi ng si gnal should be gi ven based on t he
forecast s and t he user s t radi ng pref erences.



3.1 Agent-based Model
The Agent - based Model consi st s pri maril y of a popul ation of agent s and a Vi rt ual Market
where agent s can t rade t he securi t y. An agent i s an aut onomous enti t y represent i ng a
t rader ( or invest or) wi th i t s own asset s ( cash and/ or shares) and i t s own t rading
st r at egy.

Aft er i niti al i zat i on, a new model st ar t s evol vi ng by execut i ng i t s regul ar cycl e f or every
recei ved quot e bar as i s shown bel ow.



Aft er a new quot e bar has been recei ved, agent s can pl ace a new order or remai n
i nact i ve accordi ng t o thei r t rading st rat egy. Aft er al l agent s have eval uat ed t hei r t rading
st r at egy, t he Virt ual Market det ermi nes t he cl eari ng pri ce, execut es all execut abl e orders
and rel eases t he pri ce forecast for the next bar. Fi nall y, breedi ng of new agent s and
repl acement ( by evol utionary operat i ons such as crossover and mut at i on) can t ake pl ace.
Thi s process t hen repeat s i t sel f for the next bar.

Not e t hat in most cases ( dependi ng on model set t i ngs) t he agent - based model i s not a
closed economy. The t ot al amount of money i n the model may vary because of agent
repl acement s
14
and because of broker commi ssions charged t o agent s. New agent s get
an i ni ti al weal t h ( according to t he Agent I ni ti al i zat i on set t ings) t hat i s usuall y different
( hi gher) t han t he weal t h of the repl aced agent s. On aver age t hi s has an increasi ng ef fect
on t he t ot al amount of money. When broker commi ssi ons are charged t o agent s t hese
amount s are bei ng di scarded, whi ch has a decr easi ng ef fect on t he t ot al amount of

14
Agent r epl acement may occur t hrough r egul ar br eedi ng but al so as a consequence of defaul t ed agent s.
Agent s evaluat e
t r ading r ul e and
pl ace or der s
Br eedi ng
Receive new
quot e bar
Agent - based Model
cycle
Vir t ual Mar ket cl ear ing
and f or ecast gener at ion
Agent - based Model
Adaptive Modeler
quot es
t rading
signals f orecast s
Trading System
36
money. The t ot al amount of money in t he model can be observed wi t h t he Popul at i on
Cash dat a seri es. Al so t he t ot al number of shares t hat exi st i n t he model can vary
because of agent repl acement s. New agent s get an ini ti al shares posi tion accordi ng t o
t he Agent I ni ti ali zat ion set t i ngs whi l e t he shares of t he repl aced agent are bei ng
di scarded.

3.1.1 Agent Population
At model i ni ti ali zat ion a popul at ion of agent s i s creat ed accordi ng t o the model
par amet er s speci fi ed by t he user. These paramet er s incl ude t he Popul ati on Si ze and t he
Agent ini ti ali zat i on set t i ngs. The popul at ion si ze i s generall y thousands of agent s. Upon
creat ion, each agent recei ves a st art i ng capi t al consi sti ng of cash and/ or shares
dependi ng on the di st ribution met hods sel ect ed in t he Agent i ni ti ali zat ion set t i ngs. Each
agent al so recei ves a t echni cal t rading rul e (i t s genome ) t hat i s randoml y creat ed
according t o t he Genome Set t i ngs.

Aft er all ini ti al i zat i on processes, t he agent populat i on will evaluat e i t s t radi ng rul es, t rade
and breed according t o t he Agent - based Model cycl e.

3 .1.1.1 Trading rules
The t rading rul es use hi st ori cal pri ce and vol ume dat a as i nput and, according t o t hei r
i nt ernal logi c, ret urn an advi ce consi st ing of a desi red posi ti on ( as a percent age of
weal t h) and an order li mi t pri ce for buying or selli ng t he securi t y. A market order can
al so be indi cat ed. The i nt ernal l ogi c of t he t rading rul es i s buil t from sever al operat ors
such as:
- pri ce and volume dat a access functi ons
- aver age, mi n, max funct i ons on hi st ori cal pri ce or volume dat a
- l ogi cal and compari son operat ors
- some basi c Techni cal I ndi cat ors

The t rading rul es are i mpl ement ed wi t h genet i c programmi ng t echnol ogy. For more
i nformat ion about how t he t rading rul es are const ruct ed, see I I I . Genet i c programmi ng in
Adapt i ve Model er.

3 .1.1.2 Order generat ion
Adapt i ve Model er t ransl at es t he out put of an agent s t radi ng rul e (t he advi ce ) i nt o a
buy or sell order by compari ng the desi red posi tion wi t h t he agent s current posi tion and
cal cul at ing t he number of shares t hat need t o be bought or sol d. I f shares need t o be
bought or sol d, an order will be generat ed t o buy/ sel l the requi red number of shares,
usi ng t he speci fi ed li mi t pri ce or market order i ndi cat ion.

Exampl e:
An agent s owns 1000 shares of t he securi t y and 80,000 i n cash. The securi t ys pri ce i s
38,50. The agent s weal t h i s t hus 118,500 and i ts posi tion i s 32.5%. I t s t radi ng rul e
ret urns an advi ce of a posi tion of 50% and a l i mi t pri ce of 38, 50. A li mi t order wil l then
be gener at ed t o buy 539 ( = 50% * 118,500 / 38, 50 - 1000) addi tional shares wi t h a
l imi t pri ce of 38,50.

Some i mpl ement at i on det ai l s:
- The exampl e gi ven above i s si mpl ifi ed. Act uall y, broker commi ssion cost s are
i ncluded in t he cal cul at i on as well .
- Before t ransl at ing an advi ce int o an order, t he desi red posi tion i s li mi t ed t o 100%
of weal t h for long posi ti on and -100% of weal t h for short posi t ions so t hat no
posi ti ons are bei ng ent ered t hat exceed t hese limi t s. Al so an ini ti al margi n check
i s performed t o veri fy t hat t he agent s new posi t i on (aft er t he int ended order
would be execut ed) will st ill be wi t hi n [ - 100%, 100%] of t he agent s new weal t h
t aki ng int o account t he difference bet ween t he order li mi t pri ce and t he l ast ( Real
37
Mar ket ) securi t y pri ce. I f not , t he number of shares t o buy or sel l will be reduced
accordingl y. ( Not e t hat an exi st ing short posi t ion of an agent may become l ess
t han - 100% of weal t h t hrough an increase in t he securi t y pri ce; al so see Margi n
mai nt enance bel ow) .
- I f t he di ff erence bet ween t he desi red posi tion and t he current posi tion i s l ess t han
hal f t he Mini mum posi ti on uni t , no order i s generat ed. Thi s ensures t hat no order
i s bei ng generat ed when t he desi red posi t ion i s al ready equal t o or close enough
t o t he current posi tion.
- I f an order does not get execut ed on the Virt ual Market , t he agent t hat pl aced t he
order will cancel t he order before eval uat i ng it s t radi ng rul e again. I f t he new
advi ce f rom t he t rading rul e st ill requi res a buy or sell order, an order wi ll be
pl aced again. Thi s ensures t hat each agent can have onl y one order open at a
t i me.
- Shares are consi dered t o be non- di vi dabl e. Onl y whol e numbers of shares can be
t raded.
- A long posi t ion can be changed int o a short posi t ion and vi ce versa wi t h a singl e
t ransact i on. However, t he fi xed broker commi ssion wil l be charged t wi ce.

3 .1.1.3 Margin maint enance
I f t he current posi tion of an agent becomes l ess t han -150% of i t s weal t h ( as a
consequence of an increase in t he securi t y pri ce) , t he agent will recei ve a margi n call .
Thi s means t hat a buy order will be gener at ed wi t h a li mi t pri ce set t o 5% above t he
most recent pri ce on t he Vi rtual Market . ( The desi red posi ti on will be based on t he
current advi ce as normal since t hi s i s al ways at least - 100%) . Not e t hat t hi s mechani sm
does not guarant ee t hat t he short posi tion wil l become hi gher t han -150%. The number
of margi n call s occurring can be moni t ored wi t h t he Margi n Call s dat a seri es.

3 .1.1.4 Default management
I f an agent ' s weal t h becomes negat i ve, i t i s f orced t o close any open posi ti on (regardl ess
of avail abl e cash) by pl aci ng an order wi t h a li mit pri ce 5% higher/ l ower t han t he most
recent pri ce on t he Virt ual Market . Once t hei r posi tion i s cl osed, defaul t ed agent s wil l be
repl aced in a speci al defaul t s repl acement procedure by random creat ed agent s ( i f they
wer en' t al ready repl aced by t he br eedi ng operat ion) . Not e t hat defaul t ed agent s may
conti nue t o exi st as long as t hei r posi ti on can not be f ull y closed and t hey ar e not bei ng
repl aced by t he breedi ng operat ion. I t i s t heoret i call y possi bl e t hat a defaul t ed agent
( t hat has not yet been removed) recovers and get s posi ti ve weal t h agai n. I n t hat case i t
conti nues t o exi st as normal . The number of defaul t s occurring can be moni tored wi t h t he
Def aul t s dat a seri es.


3.1.2 Virtual Market
The Virt ual Market i s a si mul at ed doubl e auct i on mar ket where all buy and sell orders
from agent s are coll ect ed. Ever y bar, aft er al l agent s have eval uat ed t hei r t rading rul e
and pl aced t hei r order (i f any) , t he Vi rtual Market cal cul at es t he cl eari ng pri ce. The
cl eari ng pri ce i s t he pri ce at whi ch the hi ghest t r adi ng volume from limi t orders can be
mat ched
15
. The Market Dept h wi ndow shows t he dept h of t he orderbook bef ore and aft er
cl eari ng. There i s no market maker. When t he t ot al number of shares offered ( at or
bel ow cl eari ng pri ce) exceeds t he t ot al number of shares asked ( at or above cl eari ng
pri ce) or vi ce versa, t he remai ning orders wil l not be ( full y) execut ed. I n t hi s case, orders
at t he cl eari ng pri ce wi ll be sel ect ed for execut ion wi th priori t y for market orders over
l imi t orders and t hen on a first - in- fi rst - out ( FI FO) basi s. Orders can be part i al l y execut ed.
I n case t her e ar e no mat chi ng l i mit orders at al l , no market orders will be execut ed
ei t her.


15
I f t he same hi ghest t r adi ng vol ume can be mat ched at mul t i pl e pri ce l evel s, t hen t he cl eari ng pr i ce wi ll be t he
average of t he l owest and t he hi ghest of t hose pr i ces. Mar ket order s have no i nfl uence on t he cl eari ng pri ce.
38
The forecast for t he real market pri ce can be based ei t her on the cl earing pri ce of t he
Vi rtual Market ( Vi rtual Market Pri ce) or on onl y the buy and sell orders of a dynami call y
changing group of t he best perf ormi ng agent s (Best Agent s Pri ce) . I n t he defaul t
configurati on the Vi rtual Market Pri ce i s used. The rat i onal e for usi ng t he Virt ual Market
Pri ce as an i ndi cat or for fut ure pri ces i s as f oll ows: Because of t he vol ume wei ght ed
cl eari ng pri ce comput at i on mechani sm, weal t hi er (more successful) agent s ( who will
gener all y pl ace bi gger orders) will have a bi gger infl uence on t he mar ket pri ce t han l ess
weal t hy (l ess successf ul ) agent s. Thi s way t he f orecast cal cul at ion mechani sm has a
prefer ence for successful t rading st rat egi es but st ill incl udes a hi gh number of di verse
t radi ng st rat egi es. The l at t er i s needed t o make t he forecast i ng mechani sm more robust
t o changes i n market behavi or si nce previ ousl y successful t radi ng st rat egi es ar e not
guarant eed t o remai n successful in t he f uture.

I n some cases, using t he Best Agent s Pri ce as t he forecast may resul t i n bet t er forecast s.
Ot her t han t hat , i t may be i nt erest i ng to compare t he forecast i ng abil iti es of t he ent i re
Vi rtual Market wi t h t hose of a ( much small er) group of onl y t he best performi ng agent s.


3.1.3 Breeding
Breedi ng i s t he process of creat i ng new agent s t o repl ace poor perf ormi ng agent s.
Breedi ng occurs by sel ect i ng pai rs of well performi ng agent s ( parent s) and producing
new genomes by recombinat ion of t he parent genomes t hrough a crossover operat i on. I n
a crossover operat i on, t he parent genomes are copi ed and t hen a randoml y chosen part
of the copi ed genome of one parent get s exchanged for a randoml y chosen part of t he
copi ed genome of t he ot her parent . The resul ting t wo new genomes ar e used t o creat e
t wo new agent s. Breedi ng can occur ever y bar or every n bars wher e n i s t he breedi ng
cycl e frequency.

3 .1.3.1 Select ion of parent s
Parent s are sel ect ed accordi ng t o the par amet er s Mi ni mum breedi ng age, I ni t i al sel ect i on
and Parent sel ect i on. Fi rst t he ini t ial sel ect ion i s made. Thi s i s a t emporar y sub
popul ation i n whi ch breeding and repl acement will t ake pl ace. The i niti al sel ect i on
consi st s of a gi ven percent age of all agent s of minimum breeding age and ol der. Then
t he p best performing agent s ( j udged by Breeding Fi t ness Ret urn) of t he ini ti al sel ect i on
ar e sel ect ed as parent s, wher e p i s t he value of Parent sel ect i on paramet er. For more
i nformat ion about t he sel ect i on process, see t he paramet er descri ptions.

3 .1.3.2 Creat ing offspring
The sel ect ed parent s are r andoml y grouped i n pai rs. For each pai r t he crossover operat or
pi cks a r andom node i n a copy of one parent s genome and t hen sel ect s anot her random
node (of the same t ype) i n a copy of t he ot her par ent s genome. The subt rees st ar t ing at
t he sel ect ed nodes are t hen swapped. To be accept ed, t he r esul ting offspri ng genomes
must meet t he Maxi mum Genome Si ze and Maxi mum Genome Dept h const rai nt s and
must be di fferent t han t hei r parent genomes. I f Creat e uni que genomes i s checked, t he
offspring genomes must al so be uni que wi t hin t he current group of parent s and offspring.
I f not accept ed, t he crossover i s ret ri ed unt il accept abl e of fspring genomes have been
creat ed or a ti me li mi t i s exceeded. ( I n some cases crossover may not be possi bl e,
resul ti ng in l ess offspring agent s bei ng creat ed) . The resul ting offspring genomes may
t hen be mut at ed, accordi ng t o the probabilit y given i n t he Mut at i on probabili t y
par amet er. Fi nal l y, t wo new agent s ar e cr eat ed and provi ded wi t h t he offspring genomes
and a st art i ng capi t al consi sting of cash and/ or shares depending on t he di st ri bution
met hods sel ect ed i n t he Agent ini ti ali zat ion set t i ngs.

39
3 .1.3.3 Replacing agent s
The creat ed offspri ng agent s wi ll repl ace t he worst performing agent s of t he ini t i al
sel ect i on ( j udged by Repl acement Fi t ness Ret urn). Not e t hat t he number of agent s t hat
ar e bei ng repl aced i s al ways equal t o t he number of of fspring agent s t hat have been
creat ed. Thi s i s t o keep t he popul ati on si ze st abl e.


3.1.4 Model Evolution

I n t he earl y st age of model evolut i on the forecast may somet i mes di verge st rongl y from
t he securi t ys pri ce. I n t hi s case t he Vi rt ual Market i s act i ng chaoti c because of an
i mbal ance i n suppl y and demand. Thi s i mbal ance i s caused by t he f act t hat at model
st art t he ini ti al posi tion of agent s may not be in l ine wi th their t rading rul es. Therefore
t he agent s fi rst need t o al i gn their port folio wi t h t he advi ce from t hei r t rading rul e whi ch
can cause heavy t radi ng volumes and bi g pri ce changes.

As t he model evol ves t wo t hi ngs will happen. Fi rst , agent s t hat happen t o have a well
performi ng t rading rul e will become weal t hi er t han l ess fort unat e agent s. Because t hey
ar e weal t hi er t hey will have more i nfluence on t he Vi rtual Market pri ce ( t he forecast )
whi ch presumabl y i s benefi ci al to t he accuracy of t he forecast . Second, t he t rading rul es
wi ll i mprove by nat ural sel ect i on as breedi ng creat es new agent s by crossover and
mut at ion of t he best performing agent s, r epl aci ng t he worst performing agent s. For t he
purpose of sel ect i ng agent s for breedi ng, the agent fi t ness i s det ermi ned by t he Breeding
fi t ness ret urn dat a seri es. For t he purpose of sel ect i ng agent s t o be repl aced ( by new
offspring) , t he agent fi t ness i s det er mi ned by t he Repl acement fi t ness ret urn dat a seri es.

The Agent - based Model i s in fact a sel f-organi zi ng syst em t hat evol ves according to a
bal anced i nt erpl ay of t wo mechani sms:
- evol ution of t rading rul es by genet i c programming ( mi cro l evel )
- co-evoluti on of agent s t hrough t rading on t he Virt ual Market and t he resul ti ng
pri ce dynami cs ( macro l evel )

3 .1.4.1 Running mult iple model evolutions
The evol ution and resul t s of mul ti pl e model s t hat wer e all based on t he same hi st ori cal
quot es and t he same model paramet er s can be di fferent . Thi s i s caused by t he use of
random numbers whi ch i s inherent t o agent - based modeling and genet i c programmi ng.
Random numbers ar e for inst ance used for t he creat i on of t rading rul es. Onl y when t he
same r andom seed val ues are used, mul ti pl e model s wil l evol ve i n exact l y t he same
way
16
.

Thi s means t hat for a gi ven securi t y and a gi ven set of paramet er val ues, i t may be
necessar y t o do a number of runs t o get a more rel i abl e and compl et e overvi ew of
resul t s. See al so Bat ch processing and aut omat i on.

3.2 Trading System

The Tradi ng Syst em consi st s of t he following component s:
- Trading Si gnal Generat or
- Trading Si mul at or
- St at i st i cal Si mul ations


16
Model s usi ng t he same hi st ori cal dat a, paramet ers and random seed may st i l l vary wi t h di fferent ver si ons of
Adapt i ve Model er. I t may t her efor e not al ways be possi bl e t o recreat e an earl i er cr eat ed model exact l y wi t h a
new versi on of Adapt i ve Model er . Model s may possi bl y al so var y across di ff er ent comput ers because of smal l
f l oati ng poi nt cal cul at i on di ff erences bet ween di f fer ent CPU t ypes, Operat i ng Syst em ver si ons and set t i ngs and
. Net r unt i me ver si ons.
40
3.2.1 Trading Signal Generator

Aft er ever y gener at ed forecast , t he Tradi ng Si gnal Generat or eval uat es whet her or not a
si gnal shoul d be generat ed. Tradi ng si gnal s are gener at ed based on t he following fact ors:
- forecast
- l ast securi t y pri ce ( on whi ch t he forecast was based)
- Allow short posit ions paramet er
- Si gnificant Forecast Range par amet er s
- Gener at e Cash signal when forecast is out side range par amet er
- Appl y FDA filt er paramet er and correspondi ng FDA fil t er set t ings

I n general , when t he forecast i s hi gher (l ower) t han t he l ast pri ce ( and t he absol ut e
di fference i s wi t hin t he Signi fi cant Forecast Range) t hen a Long (Short ) si gnal wi ll be
gener at ed. However, if Allow short posit ions i s di sabl ed, a Cash si gnal will be generat ed
i nst ead of a Short si gnal .

I f t he forecast i s equal t o t he l ast pri ce ( or t he di fference i s out si de t he Signi fi cant
Forecast Range) and Gener at e Cash signal when forecast i s out side range i s sel ect ed,
t hen a Cash si gnal will be generat ed. I f t he l at t er i s not t he case, no si gnal will be
gener at ed.

A si gnal will onl y be generat ed when t he new suggest ed posi tion di ffers from t he l ast
gener at ed si gnal . Therefore, si gnal s remai n valid until a new si gnal i s gi ven.

When Appl y FDA filt er i s enabl ed, Tradi ng Signal s will onl y be generat ed when t he
Forecast Direct ional Accuracy ( as cal cul at ed according t o t he speci fi ed FDA Set t ings ) i s
hi gher t han or equal t o t he speci fi ed Threshol d ( see al so Forecast Di rect i onal
Accuracy) .

3.2.2 Trading Simulator

The Tradi ng Si mul at or si mul at es t r adi ng according t o t he t radi ng si gnal s and t he rel evant
Trading Syst em par amet er s such as St art Capit al, Broker Commission, Spread and
Slippage ( see 5.5 Tradi ng Syst em par amet ers) .

When t he Tradi ng Si mul at or i s enabl ed, i t ent ers a long posi t i on in t he securi t y when a
Long si gnal has been gener at ed ( wi t h 100% of t ot al capi t al and aft er cl osi ng any short
posi ti on) and ent ers a short posi ti on when a Short si gnal has been generat ed ( for 100%
of tot al capi t al and af t er cl osi ng any l ong posi tion) . I f a Cash si gnal has been gener at ed
t hen t he Tradi ng Si mul at or wi ll hol d onl y cash (aft er cl osing any posi tion) . When Tradi ng
i s di sabl ed t he Trading Si mul at or will not t rade (any open posi tion wil l be closed fi rst ) .
When t he Tradi ng Si mul at or get s enabl ed, i t will fi rst open a posi ti on based on t he l ast
gener at ed si gnal .

For more informat i on on using the Trading Si mul at or, see 7.2 Using t he Tradi ng
Si mul at or. For more informat i on on vi ewi ng i t s perf ormance see 6.7 Performance
Over vi ew. Not e t hat all ret urn and performance indi cat ors i n Adapti ve Model er are
cal cul at ed af t er all cost s ( broker commi ssions, spread and sli ppage) .

3.2.3 Statistical Simulations

Whi l e t he Trading Si mul at or shows t he past and present t radi ng performance of a
part i cul ar model , i t does not gi ve insi ght i nto t he pot ent i al range of (fut ure) t rading
ret urns of mul ti pl e model s ( runs) and i t s sensi t ivi t y t o vari ous fact ors.

41
The St at i st i cal Si mul at ions i ncluded in Adapt i ve Model er est i mat e t he l i kel y range of
ret urns gi ven vari ous underl yi ng fact ors. The si mul at ion t ool s incl uded ar e Hi st ori cal
Si mul ation ( HS) and Mont e Carl o Si mul at i on (MCS) . Bot h are i mpl ement ed as dat a seri es
and ar e furt her descri bed i n 7.3 St at i sti cal Si mulat i ons and I .3. 3 St at i st i cal Si mul at i ons.

I t i s i mport ant t o underst and t hat t he St at i st i cal Si mul at i ons do not use any out put from
t he Agent - Based Model ( such as forecast s or t radi ng si gnal s) . I nst ead t hey are based on
user gi ven expect at i ons of Forecast Di rect i onal Accuracy and Forecast Di rect ional
Si gnifi cance. Addi tionall y they are based on hi stori cal securi t y pri ces ( HS) or user gi ven
expect at i ons of drift and vol atilit y ( MCS) , cert ai n Tradi ng Syst em paramet er s and
( optionall y) t he current Tradi ng Si mul at or weal t h.
42
4. Market Data

Adapt i ve Model er needs a suffi ci ent amount of hi st ori cal dat a f or i t s evolut ionary
l earning. Typi cal l y thousands of bars ar e required for consi st ent forecast i ng skill s to
devel op. Adapt i ve Model er can process bot h OHLC bars as well as t i ck dat a. Bi d and Ask
pri ces and Vol ume dat a can al so be used. Somet i mes hi st ori cal dat a may need t o be
preprocessed for best resul t s (i .e. back- adj ust i ng of fut ures cont ract s) .

4.1 Data retrieval

Adapt i ve Model er reads quot es from Comma Separ at ed Val ues ( CSV) ASCI I t ext fi l es i n
famili ar format s such as t hose used by popul ar chart ing and t echni cal anal ysi s soft ware
packages. Most dat a vendors and quot e downloaders support exporti ng quot es t o ASCI I
fil es. Several t hird part y conver si on tool s exi st as well . For exampl e, t he following dat a
feeds can be export ed t o ASCI I fil es i n real - ti me wi t h an addi ti onal tool :

- eSi gnal ( wi th QColl ect or Expert )
- DTN I QFeed ( wi t h QColl ect or for DTN I QFeed)

4.1.1 Required quote data
As a mi ni mum, t he foll owing columns are requi red in t he quot e fil e:
- Dat e
- Close

Not e t hat for ti ck dat a t he Cl ose column should be used for t rade pri ces.

4.1.2 Optional quote data
The fol lowing columns are opti onal and can be used by Adapt i ve Model er:
- Ti me
- Open
- Hi gh
- Low
- Volume
- Bi d
- Ask

Ot her col umns may al so be incl uded i n quot e files (usuall y thi s requires a header) but wil l
be i gnored by Adapt i ve Model er.

Not e: i f Open, High and/ or Low values ar e not incl uded in the quot e fil e, the following
val ues wi ll be assi gned t o t hem: Open wi ll be set equal t o Close, Hi gh will be set equal to
t he hi ghest of Cl ose and Open, and Low wil l be set equal t o t he lowest of Close and
Open. I f Open, Hi gh, Low or ot her val ues should not be vi si bl e t o agent s, t hen t he
correspondi ng genes shoul d be di sabl ed in t he Gene Sel ect i on.

4.1.3 Accepted quote intervals
Adapt i ve Model er support s any quot e int erval rangi ng from 1 mil li second t o mul t ipl e days
provi ded t hat processi ng ti me per quot e i s short enough
17
. For high- frequency dat a, t he
act ual usabl e mi ni mum i nt erval t hus depends on si t uati on speci fi c fact ors such as CPU

17
Eff ect i vel y t hi s means t hat t he t i me needed for r et ri evi ng t he quot e and gener at i ng t he forecast and si gnal
shoul d be no more t han a fract i on of t he quot e i nt er val .
43
speed, model paramet er s and dat a ret ri eval l at ency. Usuall y, processi ng ti me per quot e
i s onl y a fract i on of a second.

The quot e i nt erval si ze i s aut omat i call y det ect ed f rom t he quot e fil e. Vari abl e i nt erval s
(i . e. for const ant range bars or t i ck dat a) are al so support ed. I f a vari abl e i nt erval i s
det ect ed, an aver age ( rounded) i nt erval si ze i s cal cul at ed for pract i cal purposes such as
chart i ng
18
.

4.1.4 Quote bar timing convention
The ti me fi el d of a bar i n t he quot e fil e should indi cat e t he bars closi ng t ime. For t hi s
reason, t he quot e fi l e shoul d not cont ai n bars wit h t he mar ket s openi ng ti me. For
End-of- day fil es wi t hout ti me fi el d, Adapt i ve Model er wil l assi gn t he market cl osing ti me
( as set i n t he model paramet ers) t o ever y bar.

4.1.5 Splits and dividends
Adapt i ve Model er does not aut omat i call y adj ust for spl i t s and di vi dends.

As st ock spli t s have a di st orti ng effect on model evol uti on and on ret urn cal cul at ions, t he
quot e hi st ory fil e shoul d be adj ust ed f or spl it s before creat i ng a model . When a new spli t
occurs, a new model shoul d be creat ed aft er re- adj ust i ng t he hi st ori cal quot es.

Whet her or not hi st ori cal quot es should be adj ust ed for di vi dends and by whi ch met hod
depends on si tuat i on speci fi c fact ors and should be consi dered by t he user. Not e t hat
ret urn cal cul at ions i n Adapti ve Model er do not i nclude di vi dend payment s.

Not e t hat i t may be necessar y t o change t he rounding set t i ngs when hi st ori cal pri ces
have become very l ow aft er adj ust i ng for spli t s and/ or di vi dends.

4.1.6 Missing or irregular quotes
I f a quot e i s found wi t h a ti me ot her t han t he expect ed t i me, a noti fi cat i on will appear in
t he Logger ( see 6.10 Logger). For exampl e, quot es coul d be mi ssi ng because of holidays,
i ncompl et e dat a or ot her reasons or quot es could be out si de t he regul ar Market Tr ading
Hours. Mi ssing or i rregul ar quot es are not necessaril y a probl em (i .e. t hey could si mpl y
i ndi cat e a holi day) so normal operat i on will continue. However, t hey are bei ng report ed
t o t he Logger so t hat t he user can see t hem. By vi ewi ng t he Logger, you can i nst ant l y
check for mi ssi ng quot es or ot her i rregul ari ti es. For vari abl e int erval s, onl y notifi cat i ons
about quot es out si de t he Market Trading Hours will be report ed.

4.1.7 Decimal digits
The number of deci mal digi t s t hat i mport ed quotes ar e rounded t o can be speci fi ed by a
model paramet er ( see Deci mal pl aces) . Aft er select i ng a quot e fil e in t he New Model
di alog box, Adapt i ve Model er wil l at t empt t o aut omat i call y det ect t he number of deci mal
di gi t s t hat ar e used in the quot e fil e and set t he rounding paramet er. You should check
t hi s val ue and adj ust i t i f necessar y.

4.1.8 Quote reading process
As a model evol ves, i t will process all quot es i n the quot e fi l e. When all quot es have been
processed, t he syst em wil l continue t o read and process new quot es as soon as t hey are
added t o t he quot e fil e. There i s in fact no difference bet ween t he way t he syst em goes
t hrough hi stori cal quot es and t he way i t processes new quot es, except t hat t he l at t er will

18
Wi t h vari abl e i nt erval s, t he peri ods shown i n char t s may not be exact l y t he same as t he sel ect ed Char t
peri od i n t he mai n t ool bar.
44
go slower as i t invol ves wai ting for every new quot e. ( Not e t hat t he Eval uat ion Edi t ion
processes r ecent quot es onl y af t er a del ay of a f ew days) .

4.2 Quote file format requirements

Most quot e fil es t hat use common format s wi ll aut omat i cal l y be read correct l y by
Adapt i ve Model er wi t hout conversion. When only using Open, Hi gh, Low, Close and
Volume dat a, a header i s usuall y not necessary. Sever al dat e and ti me format s ar e
aut omat i cal l y recogni zed. I t i s al so possi bl e to use a header t o speci fy t he col umns and
t he dat e and t i me format s t o overri de aut omat i c det ect ion.

4.2.1 Quote files without header
I n many cases a header i s not necessary. I f no header i s incl uded t hen onl y Dat e, Ti me,
Open, Hi gh, Low, Close, Volume and Open I nt erest col umns are al lowed and t hey must
be i n t hi s order ( onl y Dat e and Cl ose are requi red) . Open, Hi gh and Low columns may
onl y be i ncluded al l or none. Open I nt erest may onl y be i ncluded i f Volume i s al so
i ncluded ( but will be i gnored).

The dat e f ormat wil l aut omat i cal l y be det ect ed. I f a Ti me column i s incl uded, t he t i me
must use a col on to separ at e hours, mi nut es and seconds. I t i s al so possi bl e t o combine
t he dat e and t i me i n one column, separ at ed by a space.

Some exampl es of val id quot e rows wi thout header ( header s onl y shown here for
i llust rat i on) :

Date, Close
04/29/2009,64.75

Date, Time, Close
04/29/2009,10:15,64.75

Date, Time, Open, High, Low, Close
04/29/2009,10:15,64.25,65.00,64.00,64.75

Date, Time, Open, High, Low, Close, Volume
04/29/2009,10:15,64.25,65.00,64.00,64.75,548000

Date, Open, High, Low, Close, Volume, Open Interest
05/22/2009,244.00,251.00,243.50,249.50,1380,6858

4.2.2 Quote files with header
Wi th a header, more possi bilit i es are support ed. Bi d and Ask pri ces can be i ncluded and
al so ot her columns may be i ncluded in t he quote fil e ( but wi ll be i gnored) . Columns may
be i n any order and Open, Hi gh and Low columns may be incl uded or excl uded in any
combinat ion. The dat e and t i me format can ( optional l y) be speci fi ed exact l y i n the header
t o overri de aut omat i c det ect i on and avoi d any ambi gui ti es. Al so ti me format s wi t hout
col ons are support ed such as hhmm.

Some exampl es of val id quot e rows wi th header :

Date,Time,Open,Close
29-Apr-2009,1015,64.25,64.75

Date,Time,Bid,Ask,Close,Volume
04/29/2009,10:29:56.201,41.04,41.05,41.05,200

DDMMYYYY,Time,Open,High,Low,Close,Vol
03042009,11:25,61.20,61.40,61.15,61.35,2200
45

<TICKER>,<DATE>,<OPEN>,<HIGH>,<LOW>,<CLOSE>,<VOL>
$IBM,20090429,101.98,105.00,101.67,104.04,9783700

"Date","Open","High","Low","Close","Volume","OI"
05/22/2009,244.00,251.00,243.50,249.50,1380,6858


4.2.3 Supported date formats
All common dat e format s ar e support ed. Some exampl es of support ed dat e f ormat s ( not
exhaust i ve) :

Date format Example dat e
yyyy- mm- dd 2009-04-29
mm/ dd/ yyyy 04/ 29/ 2009
dd.mm. yyyy 29.04.2009
dd- mmm- yyyy 29-Apr- 2009
yyyymmdd 20090429
yy- mm- dd 090429

Many ot her vari at ions are support ed as well .

The dat e f ormat usual l y does not need t o be speci fi ed in a header and wil l be det ect ed
aut omat i cal l y. I n some cases a l arge number of quot es may be needed t o det ect t he
mont h/ day/ year order i n t he dat e format unambiguousl y, especi all y for i nt raday fi l es. I n
t hat case i t may be necessary t o use a header t hat cont ai ns t he exact dat e format st ri ng.
For exampl e:

dd-mm-yy,Time,Bid,Ask,Close,Volume
03-02-03,9:34:21.873,35.73,35.74,35.73,100

The month/ day/ year order in the dat e format must st ay consi st ent t hroughout the quot e
fil e.

I n case t he quot e fil e cont ai ns quot es before 1/ 1/ 1930, four di gi t s must be used for t he
year.


4.2.4 Supported time formats
All common ti me format s ar e support ed. Some exampl es of support ed t i me format s ( not
exhaust i ve) :

Time format Example time
hh: mm 15: 45
hh: mm: ss.fff 15: 45: 23.863
h: mm: ss t t 3: 45: 23 PM
hhmm 1545
hhmmss 154523

Sever al ot her format s are support ed as wel l .

Hours may be in ei t her 24-hour cl ock syst em or 12-hour cl ock syst em wi t h AM/ PM
i ndi cat ion.
Fr act i onal seconds can be speci fi ed i n up t o 3 deci mal digi t s. Ei ther a peri od, comma or
col on may be used as t he deci mal separ at or.

I f necessary t he exact t i me format may be speci fi ed in a header.
46

Dat e and t i me may al so be combined i n one column, separat ed by a space
19
.

4.2.5 Delimiters
The fi el d ( column) del i mi t er may be a comma, semi col on or t ab.

4.2.6 Decimal separator
The deci mal separat or may be ei t her a period or a comma ( i f not used as t he deli mi t er) .

4.2.7 Thousand separators
Pri ce and volume val ues may cont ai n t housand separ at ors in the fol lowing ways: I f a
peri od i s used as t he deci mal separ at or, t hen commas may be used as t housand
separat ors but t he val ue must be enclosed wi t hin doubl e quot at i on marks. I f a comma i s
used as t he deci mal separat or, t hen periods may be used as t housand separ at ors.

4.2.8 Column headers
Column headers may be fi el d names such as Dat e, Ti me, Open, Hi gh, Low, Close,
Volume ( or Vol ), Bid, Ask. For t he dat e and t i me columns, al so dat e and t i me format
st ri ngs are allowed t o speci fy t he exact dat e/ t i me format . Dat eTi me can be used t o
i ndi cat e t hat t he dat e and t i me i s combi ned in one col umn. Fi el dnames are not case-
sensi ti ve. Fi el d names may al so be i ncluded wi t hin < and > or wi t hin doubl e
quot at i on marks. Ot her fi el d names will not be recogni zed and will cause t he dat a i n t hat
col umn t o be ignored.

4.2.9 Interpretation of empty fields
Empt y rows or rows cont ai ning onl y empt y fi el ds ( adj acent commas, commas at t he st art
or end of a line or fi elds cont aini ng onl y whit e space) will be ski pped. Ot herwi se, empt y
fi el ds will not be ski pped. Empt y Dat e, Ti me or Close fi el ds wi ll resul t i n an error
message. Empt y Open fi el ds will resul t in t he Close val ue bei ng assi gned t o them. Empt y
Hi gh or Low fi el ds wil l resul t in t he Open or Cl ose val ue assi gned t o t hem dependi ng on
whi ch i s higher/ l ower. Empt y Volume fi el ds will resul t in a 0 volume val ue. Empt y Bi d or
Ask fi el ds wi ll resul t in a 0 bid or ask pri ce
20
. ( Not e t hat empt y fi el ds at t he end of a line
ar e usual l y not vi si bl e in Mi crosoft Excel ) .

4.2.10 Miscellaneous requirements
- Quot es must be i n ascending order of dat e/ t i me.
- All l ines must end wi t h Carri age Ret urn (0x0D) and Li ne Feed ( 0x0A) charact er s
( CR+ LF) .
- Fil es may onl y cont ai n quot es of a singl e securi ty.
- Close pri ces must be posi ti ve ( not zero or negat ive) .
- Quot e fil es should cont ain at l east 250 quot es.
- I nt raday quot e fil es shoul d span at l east a 24 hour period or cont ain at l east 500
quot es.
- I f a quot e fi l e i s renamed, moved or del et ed during t he li fet i me of a model t hat
uses i t , t he model will ask for t he new l ocat i on of t he quot e fil e when i t needs i t
agai n. The new quot e fi l e shoul d cont ai n t he same col umns as t he ol d quot e fil e

19
When dat e and t i me are combi ned i n one col umn, i t i s not possi bl e t o speci fy t he exact dat e and t i me format
i n t he header.
20
However, t he bi d and ask genes f or t he Real Market wi l l r et urn t he Cl ose pri ce i n case t he Bi d or Ask pri ce i s
zero.
47
and t he mont h/ day/ year order i n t he dat e format shoul d still be t he same as
before.
- I f hi st ori cal quot es in a quot e fil e t hat i s being read by Adapt i ve Model er are bei ng
modi fi ed, t he ori ginal quot es may have al ready been read i nto a buff er ( whi l e t he
current model dat e i s st i ll before t hose quot es) and t he modi fi cat i ons may not be
read anymore. The buff er si ze i s about 100 li nes so quot es wi t hin 100 bars from
t he current model dat e shoul d not be modifi ed anymore.

48
5. Model configuration

When creat i ng a new model
21
, vari ous model paramet ers can be configured i n t he New
Model di al og box. Most par amet er s can al so be changed duri ng model evol uti on by
sel ect i ng Model paramet ers from t he Edi t menu. Not e t hat whil e edi ti ng paramet ers
during model evol ution, t he model continues t o evol ve in t he background (if not paused)
usi ng t he original paramet er val ues. Par amet er changes will onl y become ef fect i ve aft er
you cli ck OK or Appl y .

The vari ous t abs and fi el ds of t he New Model or Edi t Model Paramet er s di alog boxes
ar e di scussed i n thi s chapt er.

5.1 General parameters

These par amet er s can be found on t he Gener al t ab.

5.1.1 Quote history file of security
Her e t he quot e fil e of the securi t y can be sel ect ed. Thi s must be a val i d quot e fil e as
descri bed i n 4. Market dat a. The quot e fil e will be preprocessed t o det ermi ne t he quot e
i nt erval and Market Tradi ng Hours and t o do some ot her checks. Af t er preprocessi ng t he
quot e fi l e, the dat e and t i me of t he fi rst and l ast quot e and t he quot e i nt erval will be
shown.

5.1.2 Security name/description
Thi s wi ll aut omat i cal l y be set t o t he name of t he quot e fil e but you can change t hi s t o any
desi red name or descri pti on.

5.1.3 Model name
Aft er sel ect ing a quot e fil e, t he model name i s aut omat i cal l y set t o t he name of t he quot e
fil e. You can change t hi s t o somet hing el se. The model name will be used as t he def aul t
fil ename when t he model i s being saved for t he fi rst ti me. Aft er t he model has been
creat ed, t he model name can onl y be changed using t he SaveAs command from t he
Fil e menu.

5.1.4 Model evolution start date and time
The model s evol ut ion st art dat e and ti me will aut omat i call y be set t o t he earli est possi bl e
st art dat e and t i me. Thi s i s a cert ai n number of bars aft er t he fi rst quot e i n t he quot e fil e.
Thi s i s because t he t radi ng rul es need some hi st ori cal quot es before t he model st ar t
dat e. I t i s possi bl e t o set t he st art dat e and t i me t o a l at er dat e and ti me. The st art dat e
needs t o be ent er ed i n t he format shown t o t he ri ght of t he input fi el d. Thi s i s ei ther t he
US or European dat e format and depends on the dat e format set t i ng as sel ect ed in the
Opt ions di alog box.

5.1.5 Market Trading Hours
The Market Tradi ng Hours refer t o t he open and close t i mes of t he real world market
where t he securi t y i s bei ng t raded. They ar e used t o cal cul at e t he amount of dail y t rading

21
A model i s Adapt i ve Model er s mai n document t ype and cont ai ns al l t he dat a bel ongi ng t o a part i cul ar
securi t y s anal ysi s. Besi des t he st at e of t he Agent - based Model i t al so i ncl udes t he Tr adi ng Syst em, hi st ori cal
dat a and t he model paramet er s.
49
t i me whi ch i s used for accur at el y compounding ret urn or vol atil i t y dat a seri es t o periods
ot her t han t he model s quot e int erval . Al so they are used t o cal cul at e t he expect ed
dat e/ t i me of the next quot e bar t hat i s bei ng shown ( t emporari l y) in t he Current Values
wi ndow and in chart s. I ncorrect Mar ket Tradi ng Hours wi ll al so cause more noti fi cat ions
i n t he l ogger.

The Market Tradi ng Hours set t i ngs do not affect model evolution nor forecast s and
si gnal s. Al so t hey do not affect when new quot es ar e bei ng processed nor when forecast s
and si gnal s are bei ng generat ed because new quot es ar e processed as soon as t hey
appear in the quot e fil e whi ch i s followed i mmedi at el y by t he gener at i on of a new
forecast ( and si gnal i f necessar y).

Not e t hat regardl ess of t he Market Tradi ng Hours set t ings, al l quot es in t he quot e fil e will
be used. I f Pre- Market or Aft er-Hours quot es should not be used t hen t hey should not be
i ncluded in t he quot e fil e.

When a quot e fil e has been sel ect ed, t he Market Trading Hours are aut omat i call y
det ermi ned usi ng t he ti mes of t he earli est and lat est bars during the fi rst few days of t he
quot e fi l e. You shoul d veri f y t hat t he Mar ket Tradi ng Hours are correct because i t may
not al ways be possi bl e t o deri ve t he correct hours from t he quot e fil e. Especi all y t he
foll owing cases require at t ent i on:
- I nt raday quotes from cont inuous 24h market s ( i.e. Forex)
I n t hi s case t he openi ng and closi ng ti mes will bot h aut omat i cal l y be set t o 0: 00h.
Bot h ti mes shoul d manuall y be changed t o t he market closi ng ti me at t he end of t he
week (usi ng t he same t i me zone as t he t i mes in t he quot e fil e) . For cont i nuous
market s Adapt i ve Model er assumes t hat t he market will open agai n exact l y 48 hours
af t er t he cl osi ng ti me on Fri day.
- Non- int eger number of quot e int ervals per day
The number of quot e i nt erval s per day i s not a whol e number (i .e. hours on a market
t hat opens at 9.30h and cl oses at 16.00h) and in t he quot e fi l e the l ast bar of t he day
has a t i me l at er t han t he market cl osing ti me. I n t hat case t he closi ng t i me should be
set t o t he act ual market cl osi ng ti me and not to t he t i me gi ven t o t he l ast quot e ( t he
quot e will still be i mport ed t hough) .
- Quot e int ervals smaller t han 1 minut e
When t he quot e int erval i s smal l er t han 1 minut e, t he Market Tradi ng Hours may not
have been det ect ed correct l y and may need t o be correct ed manuall y.
- Variable quot e int ervals
When a vari abl e i nt erval i s used, t he Mar ket Tradi ng Hours may not have been
det ect ed correct l y and may need t o be correct ed.

5 .1.5.1 Handling changes in Market Trading Hours
Whi l e evol vi ng a model , Adapt i ve Model er can aut omat i call y check t he quot e fil e for
changes in t he securi t ys t r adi ng hours and adj ust t he Mar ket Tradi ng Hours. Thi s i s
useful in case Pre- Market or Aft er- Hours t rading periods were added duri ng t he quot e
hi st ory or when expansi ons of t hese peri ods or of the regul ar t radi ng hours occurred
during t he quot e hi st ory
22
. There are t hree ways of dealing wi t h adj ust ment s:
1. aut omat i c checki ng and adj ust ment
2. aut omat i c checki ng, prompt for adj ust ment
3. no aut omat i c checki ng or adj ust ment

The best way depends on whet her changes can correct l y be det ect ed aut omat i cal l y
( whi ch in t urn depends on t he regul ari t y of t he quot e fil e, mi ssi ng bars, et c. ) and
whet her or not you want model evol uti on to be int errupt ed for manual adj ust ment s. I n
gener al i t i s recommended t o check t he logger for noti fi cat i ons such as Mi ssing Quot e
or Quot e not wi thin Market Tr ading Hours t o see if t he Market Tradi ng Hours are st i ll
correct and have been changed correct l y during model evolution. I n general , t hese

22
Reduct i ons of t r adi ng hour s wi ll not be det ect ed aut omat i cal l y.
50
noti fi cat i ons occur occasi onal l y whi ch i s normal but when there are many t hi s may
i ndi cat e t hat t he Market Tradi ng Hours are incorrect .

I n any case, you can st il l change t he Mar ket Tradi ng Hours manuall y usi ng t he Edi t
Paramet ers di al og box. Thi s may be necessar y for i nst ance for overri ding an aut omat i c
change, forcing an undet ect ed change or for reduci ng Market Tradi ng Hours.

Not e t hat hi st ori cal changes of t he Market Trading Hours are bei ng recorded and ar e
used t o cal cul at e t he number of act ual peri ods ( by t radi ng ti me) bet ween bar s for
accur at e cal cul at i on of ret urns, vol at i lit y and ot her indi cat ors.

5.1.6 Pause model after creation
Check t hi s t o indi cat e t hat t he model shoul d be paused i mmedi at el y aft er ini ti ali zat ion of
t he agent popul ati on. Thi s makes i t possibl e t o anal yze t he i ni ti al st at e of a model before
any quot es have been processed.

5.2 Agent-based Model parameters

These par amet er s ref er t o t he Agent - based Model and can be found on the Model t ab.

5.2.1 Population Size
The popul at i on si ze i s t he number of agent s i n the Agent - based Model . Bi gger
popul ations means t hat more di fferent t rading rul es ar e compet i ng and evol ving i n
par all el at t he same t i me. Thi s increases t he chance t hat profi t abl e new t radi ng rul es
emerge on ti me when new profi t opport uni ti es in t he market ari se. A bi gger popul at ion
al so i ncreases t he abil i t y of a model t o endure different market r egi mes si nce more
di fferent st rat egi es can be st ored i n t he agent s' t radi ng rul es. A l arger popul ation si ze
al so i ncreases model st abil i t y and prevent s model s from becomi ng chaoti c wi t h ext reme
forecast s or from reachi ng a st at e of i mbal ance where no agent orders can be mat ched
and no forecast s can be produced. Bi gger populat i ons al so reduce sensi ti vi t y t o random
numbers so t hat resul t s of different runs var y l ess. However, bi gger popul at ions require
more comput at ions and make model evolut ion slower.

5.2.2 Agent Initialization
By cli cki ng t he Agent I ni t i al i zat ion but t on, a window will open wi t h set t i ngs for t he
i ni ti al i zat ion of agent weal t h and posi ti on ( asset allocat i on) . Thi s concerns t he st art
val ues of weal t h and posi ti on that ar e assi gned t o new agent s duri ng model ini ti ali zat ion
and t o new repl acement agent s t hat ar e creat ed duri ng model evoluti on. Sever al
met hods are provi ded t o assi gn ini ti al weal t h and posi ti on val ues t o agent s whi ch will be
descri bed i n det ail below. Not e t hat t he resul ting ini ti al di st ributions can easi l y be
observed by usi ng t he Pause model aft er cr eat i on set t i ng and t hen showing t he Weal t h
Di st ri bution and Posi ti on Di st ri bution dat a seri es in chart s.

5 .2.2.1 Wealt h dist ribut ion
I n general , i t deser ves ment i oning that t he i ni ti al weal t h t hat i s assi gned t o an agent has
an i mpact on t he amount of i nfl uence t hat i t can have on t he Virt ual Market pri ce. When
i ni ti al weal t h i s assi gned t o agent s by any of t he random sampl i ng met hods descri bed
bel ow, t hi s can add noi se t o t he pri ce di scovery mechani sm. To avoi d such noi se, assi gn
equal ini ti al weal t h t o all agent s.

I ni ti al weal t h can be assi gned t o new agent s by any of t he fol lowi ng met hods:

51
Equal for all agent s
All agent s get t he same ini ti al weal t h. The amount can be speci fi ed at I ni ti al weal t h .

Paret o dist r ibut ion
Agent weal t h i s randoml y sampl ed from a Paret o di st ri buti on. The Paret o di st ri bution i s a
well known power l aw di st ri buti on commonl y used t o descri be weal t h or income
di st ri butions. I n parti cul ar i t descri bes an unequal di st ri buti on where a l arge part of t ot al
weal t h i s owned by a small percent age of i ndi vi dual s ( al so known as t he Paret o pri nci pl e
or 80-20 rul e) . Thi s di st ri buti on i s generall y consi dered t o appl y best t o t he di st ri bution
of weal t h among very ri ch indi vi dual s and not necessaril y to t he rest of t he popul at i on. A
Paret o di st ri bution has t wo paramet ers: t he Mi ni mum weal t h and t he Paret o index .
The mi ni mum weal t h must be great er t han zero. The Paret o index i s a val ue great er t han
zero ( usuall y bet ween 1 and 3) t hat i ndi cat es t he unevenness i n i ncome di st ri bution. The
hi gher t he Paret o index, t he more even t he di st ri buti on i s.

Maxwell- Bolt zmann dist ribut ion
Agent weal t h i s randoml y sampl ed from a Maxwel l -Bol t zmann di st ri bution. Thi s i s an
exponent i al di st ri but ion ori ginati ng from t he fi eld of st at i st i cal mechani cs for descri bi ng
t he di st ri bution of energy of at oms in a gas. I n econophysi cs, i t s gener al si gni fi cance has
been recogni zed for descri bing t he di st ri but ion of a conserved quant i t y ( such as money)
among el ement s of a closed syst em ( such as agent s i n an economy)
23

24
.
Not e t hat al t hough money may be consi dered conserved i n a cl osed economy, weal t h
( when i t includes non- cash asset s) i s not necessaril y conserved. Weal t h may change due
t o changes i n asset pri ces or t hrough the creat i on and dest ruct i on of asset s
25
.
Furt hermore, a model in Adapt i ve Model er i s i n most cases not a st ri ctl y closed
economy ( see here) . However, f or the purpose of assi gning init i al weal t h val ues t o
agent s, t hese i nconsi st enci es are r el at i vel y minor, especi all y when t he i ni ti al posi tion
( asset al locat ion) of agent s i s set t o 0%.
The Maxwel l - Bol t zmann di st ri bution has a par amet er a whi ch i nfl uences t he magni t ude of
val ues ( more preci sel y: a = rms
2
/ 3, wi t h rms bei ng t he root mean squar e of t he
val ues) .

5 .2.2.2 Posit ion dist r ibution
I n general , i t should be not ed t hat t he i niti al posi ti on that i s assi gned t o agent s has a bi g
i mpact on t he t ot al (net ) number of shares t hat exi st in t he model and coul d t herefore
cause a bi as or unbal ance in the model , especi all y when i t i s st rongl y posi ti ve or
negat i ve. Thi s coul d resul t i n unst abl e model s or l ack of t radi ng. To prevent t hi s bi as or
unbal ance, set t he ( aver age) ini ti al posi ti on value t o 0%. ( Not e however t hat t he t ot al
number of shares t hat exi st in t he model al so vari es duri ng model evoluti on because of
agent repl acement ) .

Furt hermore, an agent s i niti al posi ti on will usuall y be changed i mmedi at el y aft er i t s
creat ion as a consequence of t radi ng according to i t s t rading rul e. The posi tion
di st ri bution may t heref ore di verge from t he chosen ini ti al di st ribution during model
evol ution.

I ni ti al posi ti ons can be assi gned t o new agent s by any of t he following met hods:

Equal for all agent s
All agent s get t he same ini ti al posi tion. The posit ion can be speci fi ed at I ni ti al posi t ion
and must be wi t hi n [ -100%, 100%] .


23
A. Dragul escu and V. M. Yakovenko, " St at i st i cal mechani cs of money", The European Physi cal Journal B, v.
17, pp. 723- 729 ( 2000) .
24
A. Dragul escu and V. M. Yakovenko, "Exponent i al and power- l aw probabi l i t y di st ri but i ons of weal t h and
i ncome i n t he Uni t ed Ki ngdom and t he Uni t ed St at es", Physi ca A 299, 213- 221 ( 2001) .
25
Never t hel ess, some empi ri cal st udi es ( i .e. t he one r ef err ed t o i n t hi s par agraph) have shown weal t h t o be
di st ri but ed exponent i all y as wel l .
52
Gaussian dist ribut ion
Agent posi tion i s randoml y sampl ed f rom a Gaussi an ( Normal ) di st ri buti on wi th t he
speci fi ed mean and st andard devi at ion. The mean must be wi thin [ -100%, 100%] . Aft er
random sampli ng, any posi ti on value l ess t han - 100% will be set t o - 100% and any value
great er t han 100% wi ll be set t o 100%.

5.2.3 Minimum position unit
Thi s i s t he mini mum uni t ( st epsi ze) of advi sed posi ti ons ( as % of weal t h) . Thi s val ue i s
ret urned by t he LevUni t gene. I t can not be changed during model evoluti on. I t i s al so
used for checki ng whet her an agent order would be of suffi ci ent si ze t o be act uall y pl aced
( see Order generat i on) .

5.2.4 Broker commission (for agents)
These are t he vi rt ual cost s per buy or sel l t ransact i on charged t o agent s for t radi ng on
t he Vi rt ual Market . By def aul t the val ues f or Broker Commi ssi on of t he Trading Syst em
ar e used here but ot her values can al so be provided. A fi xed fee ( amount ) can be
speci fi ed and/ or a vari abl e fee ( per cent age of t ransact i on value) .

5.2.5 Forecast
Her e you can speci f y whet her t he forecast should be based on t he Vi rt ual Market Pri ce
( whi ch i s t he cl eari ng pri ce on t he Virt ual Market based on t he orders of al l agent s) or on
t he Best Agent s Pri ce (whi ch i s a pri ce cal cul at ed using onl y t he orders of a group of best
performi ng agent s) . The si ze of t he Best Agent s group can be speci fi ed as a per cent age
of the t ot al popul ati on si ze.

Not e t hat t he Best Agent s Pri ce i s al ways cal cul at ed and avai l abl e for i nspect i on usi ng t he
Best Agent s Pri ce dat a seri es, al so when i t i s not being used as t he forecast . Thi s i s for
i nst ance useful for compari ng i t wi th t he Virt ual Mar ket Pri ce or for comparing i t s forecast
accur acy wi t h the Virt ual Market Pri ce forecast accur acy using any of t he dat a seri es t hat
has a source paramet er. The Best Agent s group si ze can t herefore al ways be speci fi ed.

5.2.6 Rounding

Number of decimal places t o round quot es on import ing
Quot es will be rounded ( on i mporting) to t he number of deci mal digi t s speci fi ed. Af t er
sel ect i ng a quot e fil e i n t he New Model di alog box, Adapt i ve Model er will at t empt t o
aut omat i cal l y det ect t he number of deci mal digi ts t hat are used i n t he quot e fi l e and set
t he rounding paramet er. You should check t hi s val ue and adj ust i t if necessary.

Minimum price increment for price generat ed by model
All pri ces gener at ed by t he Agent - based Model (including bid, ask pri ces, t r ades and
forecast s) wil l be rounded t o the near est rounding uni t as speci fi ed by t hi s paramet er.
Aft er sel ect ing a quot e fil e i n the New Model dial og box, t he mi ni mum pri ce increment
wi ll aut omat i cal l y be set t o 10
- n
where n i s t he number of aut omat i cal l y det ect ed deci mal
di gi t s. For exampl e, i f 2 deci mal di gi t s were det ect ed in t he quot e fil e, then t he mi ni mum
pri ce i ncrement will automat i call y be set t o 0.01. You shoul d check if t hi s value i s desi red
and adj ust i t if necessary. I n general , t he mini mum pri ce i ncrement shoul d be equal t o
t he smal l est pri ci ng uni t of t he securi t y on t he real world market . For exampl e, i f the
act ual mi ni mum pri cing uni t on t he real worl d market i s 0.05 t hen t he mi ni mum pri ce
i ncrement coul d manuall y be changed t o 0.05.

53
5.2.7 Random seed
As t he use of random numbers i s inherent t o agent - based modeling and genet i c
programmi ng, Adapt i ve Model er uses a pseudo random number generat or. Random
number are used for inst ance f or t he ini ti al creat ion of t rading rul es ( genomes) and for
t he crossover and mut at i on operat ors of t he breedi ng process. The random number
gener at or uses a Mersenne Twi st er al gori thm
26
t o produce random number sequences
t hat meet st andards t hat are gener al l y accept ed by sci ent i fi c resear chers.

The random seed i ndi cat es t he st art i ng point in t he random number sequence t o be used
and t hereby aff ect s t he ent i re sequence of random numbers t hat will be gener at ed during
a model s evol ution. Therefore, t o recreat e a part i cul ar model exact l y, t he same r andom
seed value i s requi red as was used in t he ori ginal model
27
.

You can speci fy t hat t he random seed i s t o be gener at ed from t he comput ers i nt ernal
clock or you can ent er a speci fi c seed manuall y (i .e. t o recreat e an earl i er creat ed
model ). To ent er a seed manuall y, first uncheck Gener at e seed from clock , t hen ent er
t he desi red seed val ue at Seed .

Aft er a model has been ini ti ali zed, t he random seed val ue t hat was used for t he model i s
shown i n t he Seed t ext box for fut ure reference ( al so when t he seed was gener at ed
from t he cl ock) .

Not e t hat when a model i s saved, t he current posi ti on in the random sequence i s al so
saved wi t h t he model (not vi sibl e t o the user) so t hat aft er re- openi ng a model , the
random number gener at or continues from t hat same posi ti on. Thi s means t hat savi ng
and opening a model does not have any effect on t he random number sequence and t hus
nei ther on model evoluti on.

Not e t hat some feat ures of Adapt i ve Model er t hat al so use random numbers ( such as t he
St at i st i cal Si mul ation dat a seri es and t he Genome Cr eat i on and Mut at i on Test er) use
t hei r own separ at e Mersenne Twi st er random number generat ors. Thi s i s t o ensure t hat
usi ng t hese feat ures does not in any way i nt erfere wi t h t he random number sequence
used for evol ving t he agent - based model . ( The seed val ue of t hese random number
gener at ors i s generat ed from t he cl ock and can not be observed or set by t he user) .

5.3 Genome parameters

The Genomes t ab cont ai ns paramet ers f or cont roll ing t he const ruct ion of t radi ng rul es
( genomes) . Opt i mal val ues for t hese par amet er s depend on various fact ors and may
requi re experi ment at ion. An underst andi ng of how Adapt i ve Model er uses genet i c
programmi ng t o const ruct t radi ng rul es i s recommended. More i nformat i on about t hi s i s
gi ven i n I I I . Genet i c programmi ng i n Adapt i ve Model er.

5.3.1 Maximum genome size
The maxi mum genome si ze i s t he maxi mum number of nodes ( genes) a genome i s
allowed t o have.


26
M. Mat sumot o and T. Ni shi mura, "Mersenne Twi st er: A 623- di mensi onal l y equi di st r i but ed uni f orm
pseudorandom number gener at or" , ACM Trans. on Model i ng and Comput er Si mul at i on Vol . 8, No. 1, Januar y
pp.3- 30 ( 1998) .
27
Al so i t i s necessar y t o use t he exact same hi st ori cal quot es and model paramet er s and ( i n most cases) t he
same ver si on of Adapt i ve Model er . Model s may possi bl y al so vary across di ffer ent comput ers because of smal l
f l oati ng poi nt cal cul at i on di ff erences bet ween di f fer ent CPU t ypes, Operat i ng Syst em ver si ons and set t i ngs and
. Net r unt i me ver si ons.
54
5.3.2 Maximum genome depth
The maxi mum genome dept h i s t he maxi mum number of hi erarchi cal l evel s a genome i s
allowed t o have.

5.3.3 Minimum initial genome depth
Thi s i s the mini mum number of hi erarchi cal l evel s for new genomes t hat ar e cr eat ed
during model ini ti ali zat ion. I t al so appli es t o t he mini mum number of l evel s for subt rees
t hat are creat ed by t he mut at ion operat or t o be i nsert ed i nto exi st ing genomes during
breedi ng.

5.3.4 Maximum initial genome depth
Thi s i s t he maxi mum number of hi erarchi cal l evel s for new genomes t hat are creat ed
during model ini ti ali zat ion. I t al so appli es t o t he maxi mum number of l evel s for subt rees
t hat are creat ed by t he mut at ion operat or t o be i nsert ed i nto exi st ing genomes during
breedi ng. Not e t hat i ncreasi ng t hi s value can slow down model creat i on and evol ution
si gni fi cantl y. I f genomes wi t h a hi gh number of level s ar e desi red i t i s recommended t o
consi der increasing Maxi mum Genome Dept h inst ead. Thi s will graduall y increase t he
genome dept h by crossover and mut at i on wi thout sl owing down model creat i on and
evol ution as much.

5.3.5 Genome creation gene selection
The genes (f unct ions and t ermi nal s) t o be used in creat i ng genomes for the i niti al t radi ng
rul es and for t he mut at i on operat or can be sel ect ed by t he user. By cli cking on t he
Sel ect genes but t on, a window wi ll open showing a t abl e of all the genes. I n t hi s t abl e
t he genes t o use can be sel ect ed or desel ect ed. More i nformat i on about t he genes i s
gi ven i n Funct ion and Terminal set ( pr essi ng F1 whil e t he cursor i s in a cel l wi t h a gene
or t ype wi ll show cont ext - sensi t i ve help) .

The gene sel ect i on can be changed before t he creat i on of a new model and al so during
model evol ution. When t he gene sel ect i on i s changed during model evol uti on, al ready
exi st i ng genomes wi ll not be affect ed and wil l still cont ain genes of the ol d sel ect i on.
Changi ng t he gene sel ect i on during model evolut ion onl y affect s t he new genome part s
t hat are creat ed by t he mut at ion operat or and insert ed int o new offspri ng genomes. Over
t i me, t he presence of genes i n t he t ot al genome popul at i on will shift t owards t he new
sel ect i on through t he effect s of mut at ions and repl acement s. Not e t hat changi ng t he
gene sel ect i on has no effect on t he crossover oper at i on.

Sel ect ing and desel ect i ng genes shoul d be done wi th care. Not every sel ect i on of genes
wi ll resul t i n successful genome creat i on and mut at i on. I n fact , for many sel ect i ons,
genome cr eat i on and/ or mut at ion may be sl ow or not even possi bl e at all . Thi s i s
because some genes ar e requi red for creat i ng accept abl e genomes. Whi ch genes are
requi red depends on what ot her genes ar e al ready sel ect ed and al so on t he
mini mum/ maxi mum i niti al genome dept h par amet er val ues.

When you have made a gene sel ect i on and cli ck OK , a qui ck check wi ll be performed t o
see i f a genome can be creat ed wi t h t hi s sel ect ion fast enough. I f not , a warning will be
shown. However, t hi s i s onl y a qui ck check. I t does not check how many ( uni que)
genomes can be cr eat ed per second and i t does not check whet her genomes can be
mut at ed easil y or not . Theref ore, a bet t er way of t est ing t he gene sel ect ion i s provi ded
by t he Genome Creat i on and Mut at ion Test er .

5 .3.5.1 Genome Creat ion and Mut ation Test er
The Genome Creat i on and Mut at i on Test er allows t est ing a gene sel ect i on in a safe t est
envi ronment , i sol at ed from any running model . I t i s locat ed in t he Sel ect Genes window
55
bel ow t he genes t abl e. By cli cki ng St art t he t est er wil l st art cr eat i ng genomes usi ng t he
genes sel ect ed in t he t abl e and accordi ng t o t he Genome Si ze and Dept h paramet er
val ues t hat are current l y ent er ed on the Genome t ab
28
. The t abl e shows how many
genomes coul d be creat ed i n tot al and per second, di vi ded int o unique vali d genomes,
dupli cat e genomes and invalid genomes. I nvali d genomes are f ail ed genome
creat ions t hat di d not meet maxi mum genome si ze or dept h or other cri t eri a. Dupli cat e
genomes ar e i denti cal to al ready cr eat ed genomes ( non-unique) and would onl y be
useful when t he Creat e unique genomes set t i ng i s not checked. The remaining
genomes ar e val i d and uni que and t hose are t he ones needed when Creat e uni que
genomes i s checked. ( The t est er does not care whet her or not Creat e uni que genomes
i s checked. The user shoul d deci de whi ch val ues from t he t est resul t s mat t er). The t est er
al so mut at es all t he creat ed uni que vali d genomes once t o t est whet her mut at i on i s
possi bl e and occurring fast enough. Not e t hat in some cases genome cr eat i on may go
ver y well but mut at i on may go very sl ow or vi ce ver sa. The t est er can be st opped by
cli cki ng t he St op but t on. Cli cki ng t he St art but t on agai n will erase t he pr evi ous t est
resul t and rest art t he t est er.

The t est er does not provi de any conclusi ons on whet her a gene sel ect i on i s good or not .
I t si mpl y shows how many ( unique) genomes coul d be creat ed and mut at ed and how
fast . I t i s up t o t he user t o deci de i f t hi s i s fast enough. Not e t hat t he numbers of
genomes creat ed and mut at ed per second report ed by t he t est er depend on t he avail abl e
resources on t he comput er and whet her or not a model i s evol vi ng i n t he meant i me.
They may be different t han t he number of genomes cr eat ed and mut at ed per second i n
act ual model creat i on and evol ution. The numbers ar e onl y meant t o compare t he speed
of genome creat ion and mut at i on for different genome set t i ngs and gene sel ect i ons.

Not e t hat t he Genome Creat i on and Mut at i on Test er ( nor t he qui ck check performed
when cli cki ng OK ) does not in any way affect an al ready running model nor i t s
evol ution ( even a separ at e pseudo random number gener at or i s being used) . A new gene
sel ect i on wi ll onl y become effect i ve aft er cli cking Creat e Model , OK or Appl y on t he
New/ Edi t Model di alog box. I f model evol ution becomes very sl ow or freezes af t er
accept i ng a new gene sel ect i on, t he gene sel ect ion can be changed agai n.

5.3.6 Create unique genomes
When t hi s option i s enabl ed, all genomes creat ed during model initi ali zat i on will be
unique. Enforcing uni queness i ncreases t he genet i c di versi t y of t he popul ation whi ch i s
gener all y consi dered t o have a benefi ci al effect on evol uti on. Enforcing uni queness may
slow down model ini ti ali zat i on for gene sel ect i ons for whi ch i t i s not ( easil y) possi bl e to
creat e t he requi red number of uni que genomes. I n case model i ni ti al i zat ion becomes t oo
slow or seems t o st op, you can cancel model initi ali zat ion by cli cking on t he Cancel
but t on of t he Creat ing agent popul ation window and creat e a new model wi th ot her
set t i ngs.

During model evol ution, uniqueness of new genomes t hat are creat ed for new offspring
agent s by t he breedi ng process will al so be checked ( i f thi s option i s enabl ed) but onl y
agai nst t he agent s i n t he Parent sel ect i on and t he ot her offspri ng agent s t hat are bei ng
creat ed during that breedi ng cycl e.

When t hi s option i s di sabl ed, no uni queness i s enforced and dupl i cat e genomes may
occur in t he popul ati on.


28
These val ues may be di fferent t han t hose t hat a runni ng model i s cur rent l y usi ng. Thi s al l ows t est i ng ot her
si ze and dept h paramet er val ues wi t hout di st ur bi ng t he model . They wi l l onl y become eff ect i ve for t he model i f
t he user cl i cks OK or Appl y i n t he New/ Edi t Model paramet er s di al og.
56
5.4 Evolution parameters

These par amet er s aff ect t he breedi ng process t hat t akes car e of sel ect i ng parent agent s
and creat i ng new agent s t hrough crossover and mut at ion. Opti mal values for t he
Evolut ion paramet ers depend on vari ous f act ors and requi re experi ment at ion. More
i nformat ion about t he breeding process i s gi ven i n 3.1.1 Agent Popul ati on.

5.4.1 Breeding cycle frequency
Thi s i s t he number of bars bet ween breedi ng cycl es. For exampl e, i f t he breeding cycl e
frequency i s 10, breeding wi ll onl y occur once ever y 10 bars. Not e t hat in genet i c
programmi ng t erms, i t mi ght be appropri at e t o cal l a breedi ng cycl e a gener at ion if t he
number of agent s bei ng repl aced every breedi ng cycl e i s a si gnifi cant part of the
popul ation and t he breedi ng cycl e frequency i s a suffi ci ent number of bars t o j ust ify such
bi g repl acement s. On t he ot her hand, repl acing onl y a few agent s frequent l y (i .e. ever y
bar) rat her approaches st eady- st at e evol ution.

5.4.2 Initial selection
Every breedi ng cycl e st art s wi t h an i ni ti al sel ect i on. The i ni ti al sel ect i on i s a t emporary
sub popul at ion. Breedi ng and repl acement t akes pl ace onl y wi thin t hi s sub popul ati on.
The ini ti al sel ect ion i s made by randoml y sel ect ing agent s whose age i s equal t o or hi gher
t han t he mi ni mum breeding age. Thi s i s to ensure t hat t he compari son of agent
performance i s support ed by a suffi ci ent number of bars. The si ze of t he i ni ti al sel ect i on
can be speci fi ed as a per cent age of t he t ot al number of agent s of mini mum breedi ng age
and ol der. For inst ance, when t he Popul ation Si ze i s 2000 and t here are 500 agent s of
mini mum breedi ng age and t he I ni t i al sel ect i on is set at 50% t hen t he I ni ti al sel ect i on
wi ll cont ai n 250 agent s.

Not e t hat t he number of agent s of mini mum breedi ng age and ol der (and t hus t he
number of agent s i n t he ini ti al sel ect ion) may be unst abl e, especi al l y duri ng the earl y
st ages of model evolution. Thi s i s caused by t he feed- back effect of agent repl acement
on agent age. Thi s effect can best be obser ved by showing t he Creat i ons (or
Termi nati ons) dat a seri es i n a chart .

5.4.3 Minimum breeding age
Thi s i s t he mini mum age r equi red for agent s t o qual ify for pot enti al part i ci pat ion in the
I ni ti al sel ect i on. The age of an agent i s t he number of bars t hat have been processed
since t he agent was cr eat ed. The mi ni mum breedi ng age al so speci fi es t he peri od over
whi ch agent performance wi ll be compar ed. For inst ance, i f t he Mini mum breedi ng age i s
100, t hen t he agent s performance over t he l ast 100 bars will be compared. Not e t hat t he
maxi mum compari son peri od si ze i s 250 bars. Thi s does not mean t hat t he Mi ni mum
breedi ng age can not be set hi gher t han 250, but t he peri od for performance compari son
i s maxi mi zed t o 250 bars.

Thi s paramet er bal ances t he adapt abili t y versus t he reli abil it y of t he model . Wi t h l ow
mini mum breedi ng age, new successful agent s can t ake part in breeding rel ati vel y earl y,
allowing them t o gener at e more pot ent i all y successf ul agent s. Thi s increases t hei r
i nfl uence on t he forecast and accel erat es adapt at i on of the popul ation. However, si nce
agent performance i s onl y measured over a short period, random fact ors may have a
si gni fi cant di st orting eff ect . Wi t h higher mi ni mum breeding age val ues, t he performance
i s compared over a l onger (more si gnifi cant ) period of ti me maki ng t he sel ect i on of
agent s for breeding more reli abl e.

57
5.4.4 Parent selection
The parent sel ect i on will cont ai n t he best performing agent s ( of t he i ni ti al sel ect i on) t hat
wi ll act as par ent s i n crossover oper at i ons for creat i ng new agent s. The performance
cri t eri a for sel ect i on i s t he agent s Breedi ng fi tness ret urn. Because t he par ent sel ect i on
i s a sub group of the i ni ti al sel ect i on, i t s si ze can be speci fi ed as a percent age of t he
i ni ti al sel ect i on. Not e t hat normall y every pai r of parent s wil l creat e 2 offspri ng agent s,
maki ng the number of offspri ng equal to t he number of parent s. The new agent s will
repl ace t he worst performing agent s of t he i ni ti al sel ect i on ( j udged by t he Repl acement
fi t ness ret urn) . Thi s mechani sm keeps t he populat i on si ze const ant . For inst ance, i f t he
i ni ti al sel ect i on cont ains 200 agent s and parent sel ect i on i s set at 10%, t hen 20 new
agent s wil l be bred (f rom t he 20 best performing agent s of t he i ni ti al sel ect i on) and
repl ace t he 20 worst performi ng agent s of t he i ni ti al sel ect i on.

5.4.5 Mutation probability
A new agent will be mut at ed wi t h t hi s probabil ity ( ri ght aft er i t s creat i on by t he crossover
operat i on) . Not e t hat t he act ual percent age of new agent s bei ng mut at ed may be
di fferent t han t he gi ven probabil it y. Thi s i s because t he mut at i on operat or may not
al ways succeed in performing an accept abl e mut at i on wi thin a ti me li mi t .


5.5 Trading System parameters

The Tradi ng Syst em t ab cont ains paramet er s rel at ed t o t he Trading Syst em.

5.5.1 Allow Short Positions
I f t hi s option i s checked t he Tradi ng Syst em will go short when t he forecast i s l ower t han
t he l ast avail abl e quot e ( for 100% of t ot al capi t al , aft er cl osing any l ong posi ti on). I f
unchecked, t he Tradi ng Syst em will hold onl y cash when t he forecast i s l ower t han t he
l ast avail abl e quot e ( af t er cl osi ng any long posi tion) .

5.5.2 Significant Forecast Range
I f t he absol ut e forecast ed pri ce change i s wi t hin t he speci fi ed range, t he forecast i s
consi dered significant . Thi s means t hat t he Tradi ng Si gnal Generat or can generat e a Long
or Short si gnal based on thi s forecast . Al so, t hi s range i s rel evant for t he Forecast
Di rect i onal Accuracy, Forecast Di rect i onal Significance, Forecast Di rect i onal AUC, Fi l t ered
Vol atil it y and t he St at i st i cal Si mul ati ons dat a seri es.

The upper limi t i s useful to prevent t he generat ion of Trading Si gnal s when t he forecast s
di ffer t oo much from t he securi t ys pri ce (i .e. when t he forecast s go t o ext r eme val ues or
remai n fi xed for a period of ti me) . I n general , i t i s desirabl e t hat forecast s do not di ffer
more t han at most a few st andard devi at ions of ret urn per bar from t he securi t ys pri ce,
since bi gger pri ce movement s ar e very r are i n real i t y. Theref ore set t ing t he upper li mi t to
i .e. 10% (for dai l y pri ces) will fil t er out a lot of unwant ed model behavi or while hardl y
affect i ng useful model behavi or.

The lower li mi t i s useful t o prevent t he gener at i on of t radi ng si gnal s when pri ce changes
ar e bei ng forecast ed t hat may be t oo smal l or insi gni fi cant t o act upon. Not e t hat when
t he l ower li mi t i s set t o 0%, a forecast wil l still be decl ared i nsignifi cant when t he
forecast ed pri ce change i s 0%. (I n other words, a forecast i s al ways decl ared insi gnifi cant
when t he forecast ed pri ce change i s 0%) .

58
5.5.3 Generate Cash Signal when forecast is outside range
Thi s i s t o speci fy t hat any exi st i ng long or short posi t i on shoul d be cl osed when t he
absol ut e forecast ed pri ce change i s out si de t he Si gnifi cant Forecast Range ( or 0%) .

5.5.4 Apply FDA Filter
When Appl y FDA filt er i s enabl ed, Tradi ng Signal s will onl y be generat ed when t he
Forecast Direct ional Accuracy ( as cal cul at ed according t o t he speci fi ed FDA Set t ings ) i s
hi gher t han or equal t o t he speci fi ed Threshol d. The Forecast Di rect ional Accuracy i s an
i ndi cat or measuri ng t he percent age of bars for whi ch the di rect i on of pri ce change was
forecast ed correct l y. See Forecast Di rect ional Accuracy for more i nformat ion on t hi s
i ndi cat or and i t s paramet ers.

5.5.5 Start Capital
Thi s i s t he i ni ti al capi t al (in cash) of t he Trading Si mul at or at model st art .

5.5.6 Enable Trading Simulator
Wi th t hi s swi t ch you can enabl e or di sabl e t he Tradi ng Si mul at or ( before or during model
evol ution) . When t hi s swi t ch i s checked at model st art , t he Tradi ng Si mul at or will t rade
from t he st art of model evoluti on. I f t hi s swi t ch is not checked at model st art , you can
speci fy t hat t he Tradi ng Si mul at or shoul d st art at a l at er t i me usi ng Aut o st art at bar .

Thi s swi t ch can al so be changed during model evol ution t o t emporari l y suspend or
resume t r adi ng. Not e t hat when t radi ng get s di sabl ed during model evol ution, any open
posi ti on will be cl osed first .

5.5.7 Auto start at bar
When t hi s i s checked, t he Tradi ng Si mul at or will aut omat i call y get enabl ed at t he
speci fi ed bar number. Once t he model i s evol vi ng, you can st il l enabl e or di sabl e t he
Trading Si mul at or manual l y (before or aft er aut o st art ) usi ng t he Enabl e Tradi ng
Si mul at or checkbox.

5.5.8 Fixed Broker Fee
Thi s i s t he fi xed broker fee ( amount ) per buy or sel l t ransact i on t hat will be appli ed by
t he Trading Si mul at or and t he St at i st i cal Si mul at ions. Not e t hat swi t chi ng from a short t o
a long posi tion or vi ce ver sa wil l be count ed as t wo t ransact i ons and t he fi xed broker f ee
wi ll t hus be charged t wi ce.

5.5.9 Variable Broker Fee
Thi s i s t he vari abl e broker fee ( per cent age of t ransact i on value) per buy or sel l
t ransact i on t hat wi ll be appli ed by t he Tradi ng Simul at or and t he St at i st i cal Si mul ations.

5.5.10 Average bid/ask spread
Thi s i s t he aver age (expect ed) difference bet ween t he bi d and ask pri ce of t he securi t y
on t he Real Market , expr essed as a percent age of the pri ce. I t i s used by t he Tradi ng
Si mul at or and t he St at i st i cal Si mul ation dat a seri es t o cal cul at e t he pri ce at whi ch orders
can be execut ed. Not e t hat Bi d/ Ask market dat a from t he quot e fil e i s not used by t he
Trading Si mul at or or t he St at i sti cal Si mul ati on dat a seri es.

59
5.5.11 Average slippage or price improvement
Slippage i s t he di fference bet ween t he market s bi d or ask pri ce at order pl acement and
t he act ual pri ce of order execut i on. Thi s di fference i s caused by del ays ( and for hi gh
vol ume orders, t he orders adverse i nfluence on t he pri ce until t he order has been fil l ed
ent i rel y) . Sl ippage i s expressed as a percent age of t he pri ce and can be posi ti ve or
negat i ve. Negat i ve sli ppage i s al so call ed pri ce improvement because t he order could
be execut ed at a bet t er pri ce t han t he bi d or ask pri ce. I n Adapt i ve Model er, t he sli ppage
par amet er i ndi cat es t he aver age expect ed sli ppage and i s used by t he Tradi ng Si mul at or
and t he St at i st i cal Si mul ati on dat a seri es t o cal cul at e t he expect ed pri ce at whi ch orders
ar e execut ed.

5.6 Saving and restoring model configurations

Model confi gurat i ons can be saved t o di sk separ at el y so t hat t hey can easi l y be reused
for creat i ng new model s. A saved model configurat i on i s a set of model paramet er values
and may i nclude a quot e fil e name, model st art dat e, t r adi ng syst em pr efer ences and
ot her model paramet er s.

Model confi gurat i ons can be saved wi t h or wi t hout a quot e fil e name. A confi gurat ion wi th
a quot e fil e name can t hus be used t o creat e a model for a part i cul ar securi t y. A
configurati on wi thout a quot e fil e name can be used as a t empl at e for a cl ass of
securi ti es t hat share cert ai n paramet er val ues.

When a model configurat ion t hat incl udes a quote fil e name i s opened, t he quot e fil e will
be pre- processed in t he same way as when a quot e fil e i s sel ect ed manuall y. Recall t hat
normal l y, cert ai n set t i ngs (i. e. model name, securi t y name, model st art dat e, Market
Trading Hours and rounding set t i ngs) are aut omat i cal l y det ermi ned aft er a quot e fi l e has
been sel ect ed. However, when opening a model configurat i on that incl udes a quot e fil e
name, t hese set t ings wil l be rest ored from t he confi gurat i on fil e. Onl y if one of t hese
set t i ng in t he confi gurat ion file i s empt y or invalid for t he sel ect ed quot e fi l e, i t will
aut omat i cal l y be re- det ermined based on t he quot e fil e.

Model confi gurat i ons can be saved and opened whil e creat ing a new model usi ng the
New Model di alog box. When edi ting model paramet er s duri ng model evoluti on, model
configurati ons can onl y be saved.

5.6.1 Default configuration
Whenever t he New Model di al og box i s opened, fi rst t he defaul t paramet er val ues ar e
bei ng ret ri eved f rom t he defaul t configurat ion. Aft er inst alli ng Adapt i ve Model er, t he
defaul t confi gurat ion i s set t o an i ncluded St andard confi gurat ion fi le. The defaul t
configurati on can be changed t o any ot her preferred (user cr eat ed) model configurat i on
fil e by choosing Opti ons from t he Tool s menu.
60
6. User Interface

6.1 Controlling model evolution
Model evol uti on can be paused and resumed wi th t he pause and resume but t ons i n
t he t ool bar or by pressi ng F3. When t he model is paused, t hi s i s al ways ri ght aft er a new
forecast ( and t radi ng si gnal if any) has been generat ed and before i mporti ng t he next
quot e. Model evolut i on can al so be advanced manual l y bar by bar wi th t he st ep but t on
or F4 key. The st ep funct ion can onl y be used af t er t he model has been paused fi rst .

6.2 Data series tree view
The evol ution of a model can be followed by moni toring one or more of t he vari ous dat a
seri es i ncluded in Adapt i ve Model er. A dat a seri es i s any kind of dat a t hat t he syst em
updat es duri ng model evol uti on such as pri ce dat a, forecast s, model charact eri st i cs,
ret urns, et c. Al l t he avail abl e dat a seri es ar e cont ai ned i n t he dat a seri es t ree vi ew. On
t he t op l evel t here ar e t hree mai n cat egori es:
- Securi t y ( dat a seri es direct l y rel at ed t o t he i mport ed quot e dat a of t he securi t y)
- Agent - based Model ( dat a seri es rel at ed t o t he Agent - based Model )
- Trading Syst em ( dat a seri es rel at ed t o t he Tradi ng Syst em)

By hoveri ng over t he dat a seri es names wi t h the mouse, short descri ptions will appear.
By pressi ng Shift - F1 when a dat a seri es ( not an expandabl e cat egory) i s sel ect ed, t he
document at i on for t he dat a seri es i s shown in t he Hel p wi ndow.

Some naming convent ions:
- Most Trading Syst em dat a seri es names st ar t wi t h TS t o di stingui sh them from
compar abl e dat a seri es i n the Securit y and Agent - based Model cat egori es.
- Virtual Market rel at ed dat a seri es names st art wi th VM t o di sti ngui sh t hem from
compar abl e dat a seri es i n the Securit y and Trading Syst em cat egori es.
- Agent dat a seri es (provi di ng inf ormat i on of an indi vi dual agent ) have names
st art i ng wi th Agent t o di sti ngui sh them from compar abl e Populat i on dat a seri es
t hat provi de aggregat e i nformat i on ( such as averages or di st ri butions) of t he
ent i re agent popul ati on.

Any dat a seri es can be shown in a chart si mpl y by doubl e cli cking i t s name in t he t ree
vi ew ( or by pressi ng Ent er) . Al t ernati vel y, a dat a seri es can be added t o an exi st ing chart
by draggi ng and dropping it onto t he desi red chart . Dat a seri es can al so be added t o t he
Current Val ues wi ndow by draggi ng and dropping.

There ar e t wo ki nds of dat a seri es:
- Ti me seri es
- Di st ri bution seri es

Ti me seri es ret urn hi stori cal val ues such as pri ce, ret urns, Tradi ng Si mul at or weal t h, et c.
Most dat a seri es ar e t i me seri es. When shown i n a chart , a t i me seri es usuall y i s shown
as a l ine chart al t hough ot her chart t ypes al so occur.

Di st ri bution seri es ret urn current st at i st i cs and di st ri buti on dat a of a popul ati on of val ues
such as agent weal t h di st ri buti on, agent age di st ri bution, hi stori cal si mul at ion ret urn
di st ri butions, et c. When shown in a chart , a di st ri bution seri es i s shown as a hi st ogram
showing t he di st ri bution of values. Not e t hat onl y t he current val ues of a di st ri buti on
seri es can be shown, not t he hi st ori cal values. A di st ri buti on seri es can usuall y be
recogni zed by t he word di st ri buti on in i t s name.

For some advanced i ssues about dat a seri es see 8. More about dat a seri es. A full
descri pti on of all avai l abl e dat a seri es i s gi ven in I . Dat a seri es refer ence.

61
6.3 Charts
Chart s wi ndows can cont ai n several chart s and provi de aut omat i c arrangement . The
Chart s wi ndow i t self i s a mul ti pl e-inst ance window t ype, meaning t hat mul ti pl e chart s
wi ndows ( each cont ai ning one or more chart s) can exi st si mul t aneousl y. Chart s wi ndows
can be creat ed t hrough t he Vi ew menu ( see 6.11.7 Creat i ng window i nst ances).

6.3.1 Adding charts
A dat a seri es can be shown in a chart by doubl e cli cki ng t he dat a seri es name i n t he dat a
seri es t ree vi ew ( or by pressi ng ENTER on a dat a seri es name). A dat a seri es can al so be
dragged from t he t ree vi ew t o t he t i tl e bar of t he Chart s window where t he new chart i s
t o be creat ed ( i .e. when mul t ipl e Chart s windows ar e vi si bl e).

6.3.2 Adding data series to an existing chart
A ti me dat a seri es can be added t o an exi st i ng chart by draggi ng and dropping i t s name
from t he dat a seri es t ree vi ew ont o t he desi red chart . Chart s can cont ain up t o ei ght ti me
dat a seri es. Di st ri bution dat a seri es can not co-exi st wi t h any ot her dat a seri es i n one
chart .

6.3.3 Removing charts
Cli ck t he exi t but t on in t he t op- right corner of t he chart or use t he ri ght mouse but t on on
a chart t o show t he cont ext menu and sel ect Remove Chart .

6.3.4 Removing data series from a chart
Use t he ri ght mouse but t on on a chart t o show t he cont ext menu. Sel ect t he desi red dat a
seri es and sel ect Remove .

6.3.5 Scrolling through charts
Chart s t hat cont ain ti me seri es can be scrol l ed hori zont al l y t o see t he hi st ory of t he
model . To scroll a chart , si mpl y drag t he chart surface t o t he ri ght t o move back in ti me
or to t he l eft t o move f orward i n ti me ( posi tion t he mouse on t he chart s plot area, hol d
down t he l eft mouse but t on and move t he mouse t o t he ri ght or l ef t ).

Normall y, chart s are aut omat i call y updat ed ( moved) during model evol ution and al ways
show t he most recent bar. When a chart i s scrolled back by t he user, t he vi si bl e chart i s
no l onger being updat ed by t he model t o al low undi srupt ed vi ewing ( al t hough the model
may st ill be evol vi ng) . To get t he char t movi ng agai n, si mpl y drag t he chart t o t he l eft
until the most recent bar becomes vi si bl e ( you can al so use t he smal l ri ght arrow but t on
as expl ained below) . As soon as t he most r ecent bar i s vi si bl e agai n, t he chart will be
updat ed and moved aut omat i cal l y agai n wi th model evol uti on.

When a chart i s scroll ed back, t wo small arrow but t ons wi ll appear near t he upper- ri ght
corner of t he chart ( bel ow t he maxi mi ze and cl ose but t ons). These but t ons can be used
t o inst ant l y j ump t o t he st ar t
29
or t he end of model hi st ory. Not e t hat t hese but t ons are
not shown when t he chart i s showi ng t he most recent bar.

When chart s ar e linked, scrol ling a chart will cause all the ot her chart s i n t he same
Chart s wi ndow t o scrol l synchronousl y so t hat t hey all show t he same peri od. When
chart s are not linked, ever y chart can be scroll ed independent l y.


29
I n case t he model cont ai ns more bar s t han t he maxi mum number of bars t hat can be st or ed i n memor y, t he
chart wi l l be scr ol l ed back t o t he ol dest bar i n memor y.
62
6.3.6 Maximizing a chart
A chart can be maxi mi zed (i nsi de t he Chart s wi ndow) by cli cking on t he maxi mi ze but t on
i n t he t op- right corner of t he chart . Thi s will make any ot her chart s wi t hi n t he same
Chart s wi ndow invi si bl e until t he maxi mi zed chart i s de- maxi mi zed agai n by cl i cki ng on
t he de- maxi mi ze but t on.

6.3.7 Data series names
The names of t he dat a seri es ar e shown at t he t op of t he chart i n t he corresponding
col or. The order of the dat a seri es i n t he chart s cont ext menu ( from t op t o bot t om)
corresponds wi th t he order of t he dat a seri es names at t he t op of t he chart ( from l eft t o
ri ght ) .

I n t he Opt i ons di al og box (from the Tool s menu) you can choose whet her full pat hs
shoul d be i ncluded i n t he dat a seri es names. The pat h i ndi cat es t he l ocat i on of t he dat a
seri es i n t he dat a seri es t r ee vi ew. Thi s can be useful somet i mes t o bet t er cl ari fy what
dat a seri es ar e incl uded i n t he chart s. Not e t hat in small chart s t her e may not al ways be
enough space t o di spl ay t he full names compl et el y.

Not e t hat t he names of most Trading Syst em dat a seri es ar e preceded wi t h TS to
di st ingui sh t hem from comparabl e dat a seri es in t he Securi t y and Agent -based Model
cat egori es. Virt ual Market rel at ed dat a seri es names st art wi t h VM t o di sti ngui sh t hem
from comparabl e dat a seri es i n t he Securit y and Trading Syst em cat egori es. Names of
Agent dat a seri es (provi di ng inf ormat i on of an indi vi dual agent ) ar e preceded wi t h
Agent t o di sti ngui sh t hem from comparabl e Popul at ion dat a seri es.

6.3.8 Adding a moving average
Use t he ri ght mouse but t on on a chart t o show t he cont ext menu. Sel ect t he desi red dat a
seri es and sel ect Add movi ng aver age . I f Add movi ng aver age can not be sel ect ed
t hen t hi s dat a seri es can not have a movi ng average. For more informat i on on adding
moving aver ages see 8.2 Moving Averages.

6.3.9 Adding an autocorrelation indicator
Use t he ri ght mouse but t on on a chart t o show the cont ext menu. Sel ect t he desi red dat a
seri es and sel ect Add aut ocorrel at i on. I f Add aut ocorrel at i on can not be sel ect ed
t hen t hi s dat a seri es can not have an aut ocorrelat i on indi cat or. For more informat ion on
addi ng aut ocorrel at ion indi cat ors see 8.3 Autocorrel at ion.

6.3.10 Changing parameters
Use t he ri ght mouse but t on on a chart t o show t he cont ext menu. Sel ect t he desi red dat a
seri es and sel ect Paramet er s . For more informat i on on modifying t he paramet er s of
dat a seri es see 8.1 Paramet er s.

6.3.11 Showing the data overlay
Cli cki ng on a dat a seri es name at t he t op of a chart will show a dat a overl ay for t hat dat a
seri es. Cl i cki ng once more on t he same name wil l hi de t he dat a overl ay. Doubl e- cl i cking
anywher e on t he chart s pl ot area wil l show or hide t he dat a overl ay for t he fi rst dat a
seri es i n t he chart . The dat a overl ay can al so be shown or hi dden t hrough the chart s
cont ext menu. Ri ght cli ck on t he chart t o open t he cont ext menu, sel ect t he desi red dat a
seri es and sel ect Show dat a overl ay . The dat a overl ay i s shown in t he same col or as
t he dat a seri es.

The dat a overl ay al ways incl udes t he bar number and t he dat e and ti me of t he shown
bar. For t i me seri es al so t he current val ue, previous value and t he percent age change
63
since t he previ ous val ue are shown. For di st ri bution seri es t he number of val ues
30
, mean,
st andard devi at i on, medi an, mini mum and maximum val ue are shown. For some dat a
seri es some addi ti onal i nformat i on i s shown as well .

Whi l e t he model i s evol ving ( and the chart i s not scroll ed away from t he most recent bar)
t he dat a overl ay al ways shows t he dat a of t he most recent bar. When t he model i s
paused, wai ti ng for a new quot e or when t he chart i s scroll ed away from t he most recent
bar, val ues of hi st ori cal bars can be shown (f or ti me seri es) by hol ding down t he SHI FT
key whi l e movi ng t he mouse t o t he desi red bar
31
. When an hi st ori cal value i s shown in
t he dat a overl ay, a crosshai r i s shown t o i ndi cat e t he val ue in t he chart . For di st ri buti on
seri es, when t he dat a overl ay i s shown, bin det ai l s can be shown by holdi ng down t he
SHI FT key whil e moving t he mouse across bi ns.

When a model i s paused, wai t ing for a new quot e or when t he chart i s scroll ed away from
t he most recent bar, t he dat a overl ay for t he first dat a seri es can al so be shown
i mmedi at el y by holding down SHI FT whi l e movi ng t he mouse over t he chart .

When chart s ar e linked, moving the crosshai r ( by holding down SHI FT whi l e movi ng t he
mouse) wil l cause any crosshai rs in ot her chart s (in t he same Char t s wi ndow) to move
synchronousl y so t hat t he dat a overl ays all show t he same bar. Thi s makes i t easy t o
i nst ant l y see t he val ues of sever al dat a seri es at t he same bar.

The reason for showing t he bar number, dat e and ti me for each dat a seri es i n t he dat a
overl ay i s t hat not all dat a seri es ar e updat ed at t he same t i me during t he Agent - based
Model cycl e. Al so not all dat a seri es show t he same dat e and t i me for a gi ven bar
number. ( Most dat a seri es ret urn t he dat e and t ime of t he close of t he bar. I f a dat a
seri es ret urns anot her dat e and t i me t hen t hi s i s expl ained i n I . Dat a seri es ref erence) .

6.3.12 Linking charts
When t he l ink chart s but t on in t he t ool bar i s enabl ed, al l t he chart s i n t he same Chart s
wi ndow are li nked . Thi s means t hat duri ng manual scroll ing ( dragging) of a chart t o see
hi st ori cal val ues, all t he ot her chart s i n t he same Chart s window wi ll scrol l synchronousl y
t o show t he same peri od. Al so all vi si bl e dat a overl ays and crosshai rs will show t he
val ues of t he same bar. When linki ng i s di sabl ed, all chart s can be cont roll ed indi viduall y.

6.3.13 X-axis for time series charts
6 .3.13.1 Chart period
The chart peri od i s t he peri od of ti me shown in ti me seri es char t s and can be changed by
sel ect i ng t he desi red Chart peri od in the t oolbar. Al l ti me seri es char t s use t he same
chart period and show t he same r ange of values on t he X- axi s. ( When a vari abl e quot e
i nt erval i s used, t he peri ods effect i vel y shown in chart s may not be exact l y as l ong as t he
sel ect ed Chart period ) .

The number of dat a poi nt s plot t ed i n a chart does not depend on t he chart s wi dt h. When
resi zing t he appl i cat ion wi ndow or when addi ng or removi ng chart s, t he chart s continue
t o show t he same informat i on. However, for some dat a seri es t he chart wi dt h may affect
t he way t he values are plot t ed depending on t he avail abl e space per bar. For i nst ance,
when a chart i s t oo small , open- high-low- cl ose bars wil l not be drawn.

For l ong chart peri ods ( spanning several t housands of bars) some dat a seri es ( i .e. Signal
and Ri ght / Wrong Forecast ed Pri ce Changes) may not be drawn because of insuffi ci ent

30
The number of val ues i ndi cat es t he number of val ues i ncl uded i n t he di st ri but i on. Because some di st ri but i on
seri es ar e rel at ed t o agent charact er i st i cs t hat can not al ways be cal cul at ed for each agent ( i .e. when an
agent s age i s st il l t oo l ow) , l ess val ues may be i ncl uded t han t he popul at i on si ze.
31
When t oo many bars ar e shown i n t he chart t o l ocat e ever y i ndi vi dual bar, t he vert i cal posi t i on of t he mouse
can be used for fi ne t uni ng.
64
space t o render t hei r values cl earl y. I n t hi s case t he name of t he dat a seri es above t he
chart wil l be shown in gray.

6 .3.13.2 Posit ioning and meaning of X- Gridlines
The X- Gridlines are al ways drawn at t he st art of a peri od (i .e. day, week, mont h) except
when t here i s no bar at t he st art of t he period (i.e. i n case of a mi ssi ng quot e). I n t hat
case t he gri dli ne will be drawn at t he first avail abl e bar of t he period. When many quot es
ar e mi ssing (i .e. during Pre- Market or Aft er- Hours) t hi s i s vi sual i zed cl earl y by t he
gri dl ines as t hey get cl oser t o each ot her. Not e t hat a gri dli ne will onl y be drawn i f i t i s at
l east 2 bar s separ at ed f rom t he previous gridl ine.
6 .3.13.3 X- axis labels
The X- axi s l abel s are drawn at t he gri dl ines when t here i s enough space. The X- axi s
l abel s can have t he following format s dependi ng on t he chart peri od shown and t he si ze
of the chart :

X- Gridli ne l abel Format Example ( 7 / 3 0/ 200 4 10:21:4 2. 793)
mm: ss.fff 21: 42.793
H: mm: ss 10: 21: 42
H: mm 10: 21
d H: mm 30 10: 21
M/ d H: mm 7/ 30 10: 21
M/ d 7/ 30
M/ d/ yy 7/ 30/ 04
MM/ yyyy 07/ 2004
yyyy 2004

Not e: t he t abl e above shows t he US dat e format s ( mm/ dd/ yy) . Thi s i s the defaul t
set t i ng. The dat e format can be changed t o European ( dd/ mm/ yy) in t he Options di alog
box ( from t he Tool s menu) .

When a chart i s scroll ed back, t he l abel s will use ot her format s wi t h more compl et e dat e
and t i me i nformat i on so that i t i s easi er t o see what peri od i s bei ng shown in t he chart .

6.3.14 X-axis for distribution series charts
6 .3.14.1 Hist ogram bin size
The hi st ogram bin si ze i s aut omat i call y det ermi ned based on t he val ues t o show
32
.
6 .3.14.2 Bin range shown
By defaul t , t he range of values shown on t he X-axi s i s 10 st andard devi at i ons wi de and
runs from [ - 5, +5] where is the mean. For data series whose val ues can not be
negat i ve, t he range st art s from 0 or - 5 whichever is greater and ends 10 further.
Not e t hat t he first bi n al so cont ai ns all t he val ues t hat ar e lower t han i t s l ower bound and
t he l ast bin al so cont ai ns all t he val ues t hat ar e hi gher t han i t s upper bound.
6 .3.14.3 Posit ioning and meaning of X- gridlines and labels
The X- gri dli nes are al ways shown at and at st andard devi at i on i nt erval s from . The
gri dl ines l abel i s shown in the dat a seri es col or. For exampl e, t he gri dline direct l y t o t he
l eft of the gridline indi cat es - and the gridline directly to the right of the gridline
indicates +. Note that the X- gri dli nes are dr awn at t hei r exact l ocat ion and do not
necessari l y coinci de wi t h bin edges. So i f for inst ance t he gri dli ne i s drawn hal fway a
bi n t hen some of the val ues i n t hat bin may be small er than whil e ot hers may be

32
The bin size (W) is automatically set according to W=3.49N
- 1/ 3
where is the standard deviation and N is
t he number of sampl es ( D. Scot t , On Opt i mal and Dat a- Based Hi st ograms , Bi omet ri ka, Vol . 66, No. 3. ( Dec.,
1979) , pp. 605- 610) . Thi s f unct i on general l y ret urns t he opt i mal hi st ogr am bi n si ze whi ch provi des t he most
eff i ci ent , unbi ased est i mat i on of t he pr obabi l i t y densi t y funct i on. For dat a ser i es t hat onl y r et urn i nt eger val ues
( i .e. agent age) t he bi n si ze i s rounded t o ensur e t hat bi n edges coi nci de wi t h i nt eger val ues.
65
hi gher t han . The X- axi s l abel s are shown at t hose X-gri dlines where t here i s enough
space t o show t hei r l abel .

6.3.15 Y-axis
6 .3.15.1 Y- axis scaling
Chart scaling for ti me seri es i s aut omat i cal l y set t o l inear or logari t hmi c dependi ng on t he
dat a seri es i n t he chart and t heir value ranges t o be shown. Logari thmi c scal ing will be
used for dat a seri es whose val ues ar e rel at ed t o pri ces, weal t h or ret urns and for the
mean f orecast error dat a seri es.
6 .3.15.2 Y- axis labels
The Y- axi s l abel s use sci ent i fi c not at i on for very hi gh or low numbers. So 1.00E+ 06 i s 1
mil lion, 2.50E+ 07 i s 25 milli on, 5.32E-05 i s 0.0000532, et c. Not e t hat when l ogari t hmi c
scal i ng i s used, Y- axi s l abel s are onl y shown at t hose Y- gri dli nes where t her e i s enough
space t o show t hei r l abel .

6.4 Current Values
The Current Val ues wi ndow shows t he current ( or l at est ) val ues of dat a seri es. Dat a
seri es can be added t o t he Current Val ues wi ndow by dragging and dropping t hem from
t he dat a seri es t ree vi ew. For di st ri bution seri es t he mean val ue will be shown.

By cli cki ng t he ri ght mouse but t on on a dat a ser i es row in t he dat a gri d, t he cont ext
menu of t he dat a seri es appear s cont ai ning options t o change i t s paramet ers, t o add a
moving aver age or an aut ocorrel at ion indi cat or or to remove t he dat a seri es from t he
Current Val ues wi ndow. For more i nformat i on about these opt ions see 8. 1 Paramet ers,
8.2 Movi ng Averages or 8.3 Aut ocorrel at i on.

I n t he Opt i ons di al og box (from the Tool s menu) you can choose whet her full pat hs
shoul d be i ncluded i n t he dat a seri es names. The pat h i ndi cat es t he l ocat i on of t he dat a
seri es i n t he dat a seri es t r ee vi ew.

6.5 Trading Signals

The Tradi ng Signal s panel shows t he l ast 100 t radi ng si gnal s t hat wer e generat ed. Wi t h
ever y si gnal , t he cl osing dat e, t i me and pri ce of t he l ast quot e bar on whi ch t he si gnal
was based are shown. For more i nformat ion on how Tradi ng Signal s are gener at ed see
3.2.1. Tradi ng Signal Generat or.

The t rading si gnal s can al so be vi suali zed i n a chart by using t he Si gnal s dat a seri es. Al so
t hey can be fol lowed by addi ng t hi s dat a seri es t o t he Current Val ues wi ndow.


6.6 Population Window
The Popul at ion window offers sever al ways t o visuali ze t he dynami cs of t he agent
popul ation. Basi cal l y, t he Popul at i on window shows scat t er pl ot s of one agent propert y
agai nst anot her (i .e. agent weal t h agai nst agent age) . Thi s can hel p identi fyi ng
rel at ionships bet ween di fferent properti es whi ch may provi de i nsi ght int o t he part i cul ar
dynami cs of a model . The properti es t hat can be plot t ed are t he Agent dat a seri es ( in t he
Agent cat egory of the dat a seri es t ree vi ew) as well as some ot her val ues such as age
and genome si ze. I t i s recommended t o read t he document at i on of Agent dat a seri es t o
bet t er underst and t he possi bil iti es of usi ng t hese dat a seri es i n t he popul ation window.

66
The Popul at ion window i s a mul ti pl e-inst ance window t ype meaning t hat mul ti pl e
Popul ation wi ndows can exi st si mul t aneousl y. Thi s may be useful for moni tori ng diff erent
set s of agent propert i es si mul t aneousl y wi thout havi ng t o swi t ch bet ween properti es all
t he t i me. Popul ati on windows can be cr eat ed t hrough the Vi ew menu ( see 6.11. 7
Creat i ng window inst ances) .

6.6.1 Scatter plots
By sel ect i ng t he desi red agent propert i es from t he X and Y drop- down l i st s, al l agent s
wi ll be plot t ed using t he X propert y for t he hori zont al posi ti on ( along t he X- axi s) and t he
Y propert y for t he vert i cal posi ti on ( along t he Y-axi s) . ( Agent s whose X- propert y or Y-
propert y have no val ue will not be plot t ed). By defaul t t he X- axi s and Y- axi s scal ing i s
done i n the same way as t he di st ri bution chart s X- axi s. I t i s possi bl e t o sel ect ot her axi s
ranges and gri dline i nt erval s for bot h axes ( see 6.6.4 and 6.6.5) .

6.6.2 Density charts
As an al t ernat i ve t o a scat t er pl ot , a densi t y chart can be shown by cl i cki ng on t he
Densi t y chart but t on. A densi t y chart doesnt plot indi vidual agent s but shows t he
number of agent s per ar ea by color int ensi t y. A densi t y chart can t herefore be seen as a
2- di mensional di st ri buti on chart where t he color int ensi t y i ndi cat es t he frequency. The
ar ea uni t di mensions are one X- bi n by one Y- bin ( see Hi st ogram bin si ze) . A l egend
showing t he frequency values for t he dif ferent col or i nt ensi ti es i s shown at t he t op of t he
chart . A densi t y chart can be useful when many agent s ar e cl ose t oget her i n a scat t er
pl ot and overl ap each ot her whi ch would make i t di ffi cul t t o see how many agent s ar e i n
a gi ven area.

6.6.3 Using the Z (color) dimension
I n a scat t er pl ot i t i s possi bl e to show a t hi rd agent propert y by color (i nt ensi t y) . By
sel ect i ng t he desi red agent propert y from t he Z ( col or) drop- down li st , t he agent s will
be plot t ed using t hi s propert y t o set t hei r color (i nt ensi t y) . Hi gher color i nt ensi ti es
i ndi cat e hi gher val ues. A l egend wi th t he propert y val ues for the di fferent color int ensi t i es
i s shown at t he t op of t he chart . Not e t hat propert i es whose val ues can be posi ti ve and
negat i ve will use blue for posi ti ve val ues, red for negat i ve val ues and whi t e
33
for zero
val ues. Properti es whose val ues can onl y be posi ti ve or zero will onl y use i nt ensi ti es of
yel l ow
34
. Agent s whose Z-propert y has no value will be plot t ed i n green, i ndi cat ing not
avail abl e ( N/ A) .

6.6.4 Changing the axes ranges
By defaul t t he X- axi s and Y- axi s range i s 10 st andard devi at i on int erval s ( see 6.3.14.2) .
By cli cki ng on t he X- axi s set t i ngs but t on (or Y- axi s set t i ngs but t on) , t he X- axi s ( or Y-
axi s) t ool bar will appear. On t hi s t ool bar t he range of val ues t o be shown on t he axi s can
be set . There ar e t hree range modes:
1. Aut o: aut omat i call y set s t he r ange from t he mini mum t o t he maxi mum val ue t hat
occur in t he agent popul ati on.
2. St dev i nt erval s: set s t he range t o t he user speci fi ed number of st andard devi at ion
i nt erval s, cent ered around t he mean.
3. Fi xed range: set s t he range t o t he user speci fi ed val ues, all owing zoomi ng in on
any area.

Not e t hat agent s whose propert y val ues are outsi de t he shown range are pl ot t ed on t he
edge of t he chart t o i ndi cat e t hat t here are agent s out si de t he shown range.


33
Gray on whi t e backgrounds.
34
Bl ack and gray on whi t e backgr ounds.
67
6.6.5 Changing the gridline intervals
By defaul t , t he X- and Y- gri dli nes are shown at t he mean and at st andard devi at ion
i nt erval s from t he mean (li ke t he X- gri dli nes i n di st ri bution chart s, see 6.3.14.3) . Usi ng
t he X- axi s ( or Y-axi s) t ool bar, any of t he following gridl ine modes can be chosen:
1. Round numbers: gri dlines are drawn at round numbers
2. St dev i nt erval s: gri dlines are drawn at t he mean and at st andard devi at i on
i nt erval s from t he mean ( t he defaul t mode)
3. Bin edges: gri dli nes coinci de wi t h bin edges ( t hey ar e not necessaril y drawn at
ever y bin edge)

6.6.6 Showing the data overlay
By cli cki ng on t he Show Dat a Overl ay but t on, dat a overl ay wi ndows ar e shown for each
of the sel ect ed propert i es ( X, Y and Z) cont aining t he number of val ues
31
, mean,
st andard devi at i on, medi an, mini mum and maximum val ues. Cli cking once more on the
but t on wi ll hide t he dat a overl ays.

6.6.7 Showing correlation and regression
Cli cki ng on t he Show Correl at i on and Regressi on but t on will show an overl ay wi ndow
cont ai ning t he correl at ion ( r) and r- squared ( r
2
) values of t he correl at i on bet ween X and
Y. Al so t he regression li ne formul a i s shown and t he li ne i t sel f i s drawn. The correl at i on
val ue r i s t he Pearson product -moment correl at ion coeffi ci ent and can range from + 1 for
perfect posi ti ve correl at ion t o - 1 for perfect negat i ve correl at ion. A val ue of 0 indi cat es no
correl at ion at al l . The val ue r
2
( al so known as t he coeffi ci ent of det ermi nat ion) i s t he
squar e of t he correl at ion coeffi ci ent r and ranges from 1 for perfect ( posi t i ve or negat i ve)
correl at ion t o 0 for no correl at i on at all . Whil e r indi cat es t he di rect i on of the correl at i on
( posi ti ve or negat i ve) , r
2
i ndi cat es t he st rengt h of the correl ati on.

6.6.8 Setting the agent dot size
Usi ng t he Agent dot si ze but t on, t he si ze of t he agent dot s as t hey ar e plot t ed on a
scat t er chart can be set . Larger dot s are more clearl y vi si bl e but may overl ap each ot her
and hi de informat ion. Small er dot s have l ess overl ap and t hus show more i nformat ion
but may be l ess cl earl y vi si bl e.


6.7 Performance Overview
The Performance Over vi ew shows t he performance of t he Tradi ng Si mul at or and can be
shown by sel ect i ng Performance i n t he Vi ew menu. The Performance Over vi ew
cont ai ns various i ndi cat ors of ret urns, ri sks and sub period st at i st i cs. Not e t hat t he
performance cal cul at ions of t he Trading Si mul at or t ake int o account al l t ransact i on cost s
(i . e. t he broker commi ssi ons, spread and sl ippage as speci fi ed in t he Tradi ng Syst em
Paramet ers) .

6.7.1 Settings
Performance i s cal cul at ed according to t he Performance Cal cul at i on Set t ings t hat ar e
shown i n t he t op-l eft . They can be changed by cli cki ng on t he Set t i ngs but t on above
t he Performance Overvi ew. The set t i ngs are di scussed in det ai l below.

6 .7.1.1 Calculation Period
The peri od over whi ch perf ormance shoul d be cal cul at ed can be speci fi ed i n t he same
way as for dat a seri es wi th a cal cul at i on period par amet er. All i nformat i on shown on t he
Performance Overvi ew i s al ways based on t he speci fi ed cal cul at i on peri od.
68

I f t he Trading Si mul at or has not st art ed yet or i f t he cal cul ati on period st art s before
Trading Si mul at or st ar t , no performance i nformat i on i s shown. Al so, if t he cal cul at ion
peri od st art s or ends aft er t he current model bar, no performance i nformat ion i s shown.
I n t hese si t uat ions, t he Performance Over vi ew shows I nsuffi ci ent dat a .

6 .7.1.2 Compounding Period ( sub period size)
The compounding peri od speci fi es t he peri od t o whi ch ret urns and vol at il iti es are being
compounded ( al so see Compounding period) . The compounding peri od al so speci fi es t he
si ze of t he sub periods for whi ch ret urns are shown in the Period Ret urns t abl e.

6 .7.1.3 Risk Free Rat e
The Ri sk Free Rat e i s used for t he cal cul at i on of t he Sharpe Rat i o, Alpha, and Ri sk-
adj ust ed Ret urn on t he Performance Overvi ew. The Ri sk Free Rat e i s al so used as t he
mini mum accept abl e ret urn for t he cal cul at ion of t he Sortino Rat io. See t he di scussi on of
t hese dat a seri es i n t he Dat a seri es ref erence for more i nformat i on.

6 .7.1.4 VaR Confidence Level
The VaR Confi dence Level i s used for t he cal cul at i on of the Val ue at Ri sk, Rel at i ve Val ue
at Ri sk and t he Ri sk- adj ust ed Ret urn on t he Performance Overvi ew. See t he di scussi on of
t hese dat a seri es i n t he Dat a seri es ref erence for more i nformat i on.

6.7.2 Status information
I n t he t op- ri ght , some st at us informat i on i s shown. Thi s incl udes t he following
i nformat ion:
- Number of bars: number of bars i n t he cal cul at ion peri od
- Weal t h at st art : Tradi ng Si mul at or weal t h at t he st art of t he cal cul at ion peri od
- Weal t h at end: Trading Si mul at or weal t h at t he end of t he cal cul at ion peri od
- Act ual periods: act ual number of sub periods ( of compoundi ng peri od si ze) i n t he
cal cul at ion period
- FDA: Forecast Di rect i onal Accuracy duri ng t he cal cul at ion peri od
- Trades: number of t rades of t he Tradi ng Si mul at or duri ng t he cal cul at i on peri od

6.7.3 Performance calculation
The indi cat ors under t he headings Ret urn , Relat i ve Ret urn , Ri sk and Reward/ Ri sk
Rat i os are cal cul at ed by t he correspondi ng dat a seri es in t he Tradi ng Syst em\ Tradi ng
Si mul at or subcat egory of t he dat a seri es t r ee view. They use t he performance
cal cul at ion set t i ngs as paramet er val ues where appli cabl e. However, t he following
i ndi cat ors use al t ernat i ve par amet er values:
- Bet a: t he pri ce change cal cul ati on peri od i s al ways t he model s quot e int erval .
- Hi st ori cal Vol at ili t y: t he vol atili t y i s cal cul at ed using act ual mean log ret urn".
- VaR and Rel at i ve VaR: t he t i me hori zon peri od lengt h i s al ways 1 bar.

See 8. More about Dat a Seri es for general i nformat i on about when and why dat a seri es
ret urn no val ue due t o insuffi ci ent dat a or memory limi t at ions. See Dat a seri es refer ence
for informat i on about how speci fi c dat a seri es are cal cul at ed.

6.7.4 Sub period information
The Performance Over vi ew cont ains a t abl e of sub period ret urns f or t he Tradi ng
Si mul at or and for the Securi t y i t sel f ( servi ng as a benchmar k) . The sub peri od l engt h i s
equal t o the speci fi ed compoundi ng period l engt h. The column headers show t he st art
69
dat e/ t i me of the corresponding peri od (using t he same format s as t he X- axi s l abel s i n
chart s) . Not e t hat period st art dat es ar e defi ned by t he fi rst quot e bar of t he new peri od.
Part i al peri ods are al so included i n t he t abl e and mar ked wi t h a * . For exampl e, i f the
cal cul at ion period st art ed af t er t he st art of a per i od, t hi s fi rst peri od i s a part i al period.
Whi l e t he current model dat e i s before t he end dat e of a peri od, t he l ast peri od i s a
part i al peri od. Not e t hat t he ret urn of t he l ast ( part i al ) period i s recal cul at ed every new
bar unti l t he peri od i s compl et e.

Below t he t abl e, t he aver age and st andard devi at ion of the Trading Si mul at or period
ret urns are shown. (Because t hi s i s an ari t hmet i c aver age, i t i s not equal t o t he
compounded ret urn shown under Ret urn whi ch i s a geomet ri c aver age) . Al so t he
number of wi nni ng and losi ng peri ods and t hei r aver age ret urns ar e shown. A winning
peri od i s a peri od wi th a Tradi ng Si mul at or ret urn great er t han 0%. A losi ng peri od i s a
peri od wi th a Tradi ng Si mul at or ret urn l ess t han 0%. Periods wi t h a Trading Si mul at or
ret urn of exact l y 0% are not count ed as a wi nning or losing peri od. For t hi s reason t he
t ot al number of winning and losi ng periods can be l ess t han t he t ot al number of periods.
Not e t hat in t he numbers of wi nning and l osing periods al so the l ast ( part i al ) period may
be i ncl uded whose ret urn i s recal cul at ed ever y bar. The numbers may t herefore go up or
down by 1 every bar.

I f t he number of request ed peri ods i s great er t han 500 t hen onl y t he first 500 periods wil l
be shown in t he t abl e. However, all periods will be incl uded in the cal cul at i ons.


6.8 Market Depth
The Market Dept h window shows t he dept h of t he orderbook of t he Vi rt ual Market and
provi des furt her i nsi ght int o t he vi rtual market pri ci ng mechani sm. I n t he bar chart , t he
t ot al volume of out st andi ng buy and sell limi t orders i s shown at each pri ce. By def aul t ,
t he si t uat i on before clearing i s shown. Blue bars represent buy vol ume, red bar
represent sell vol ume and yellow bars represent buy and sell volume at t he same pri ce
35
.
The cl earing pri ce i s i ndi cat ed above t he chart
36
. Not e t hat volume from market orders i s
not i ncluded in t he bars.

By cli cki ng t he but t on show orders before cl earing in the t oolbar, you can swi t ch
bet ween vi ews of t he orderbook before or aft er market cl earing. Thi s way you can easil y
see what vol ume was t r aded at what pri ces during t he l ast vi rt ual market cl eari ng
37
.
Aft er cl eari ng, t he buy vol ume t o t he right of t he cl eari ng pri ce ( hi gher bi d pri ces) and
t he sell vol ume t o t he l eft of t he cl eari ng pri ce (lower ask pri ces) shoul d most l y have
di sappeared
38
.

By cli cki ng t he but t on show cumul ati ve volumes in t he t ool bar, cumul ati ve volumes can
be shown. Thi s shows t he cumul at i ve vol ume of buy (sell ) orders wi t h a limi t pri ce at or
above ( bel ow) each pri ce, or i n ot her words t he t ot al volume of buy ( sell ) orders t hat
coul d be t raded at each pri ce if t hat pri ce wer e t o become t he cl eari ng pri ce ( provi ded
t hat suffi ci ent sel l ( buy) vol ume i s avail abl e) .

By cli cki ng t he but t on Show order numbers , an overl ay window i s shown wi t h a
summar y t abl e of t he number of buy and sell orders grouped by li mi t and market orders.

The pri ce range t o show can be set i n t he t ool bar. The pri ce range i s expr essed in a
number of st andard devi at i ons of pri ce changes above and bel ow the cl eari ng pri ce. The

35
The yel l ow bars do not necessari l y represent al l mat chi ng vol ume ( vol ume of order s t hat wi l l be execut ed at
market cl eari ng) because t he book may al so cont ai n sel l orders wi t h an ask pri ce bel ow t he bi d pr i ce of a buy
order. I n t hi s case t hese or ders wi l l be execut ed but wont show up as yel l ow bar s si nce t he bi d and ask pri ces
are di fferent .
36
I f no orders coul d be mat ched, no cl eari ng pri ce wi l l be shown above t he chart .
37
Not e t hat shar es can al so be t raded at ot her pri ces t han t he cl eari ng pr i ce i n case t he l owest ask pri ce i s
bel ow t he hi ghest bi d pri ce.
38
Except i ons t o t hi s are caused by an i mbal ance i n t he t ot al buy and sel l vol ume.
70
act ual pri ce range shown i s an approxi mat i on of t hi s and i s kept as st abl e as possi bl e for
vi ewi ng comfort . By sel ect ing l arger pri ce ranges, t he shown range wil l change l ess oft en.
By sel ect i ng Al l , the exact t ot al pri ce range of t he orderbooks will be shown ( whi ch will
cause t he shown range t o change al most ever y bar) .


6.9 Agent Window
The Agent window gi ves an overvi ew of a singl e agent cont ai ning i t s weal t h, ret urn,
genome st at i st i cs, et c. Act uall y, t he Agent window shows a par t i cul ar Agent slot i n the
popul ation. Therefore, when an agent t hat i s occupyi ng t he sl ot bei ng shown i s
t er mi nat ed, a new agent t akes over t hat sl ot and i s shown in t he Agent wi ndow. Thi s can
easil y be seen by t he agent age bei ng reset t o 1.

The Agent window i s a mul ti pl e-inst ance window t ype meani ng t hat mul ti pl e agent
wi ndows can exi st si mul t aneousl y. Agent windows can be cr eat ed t hrough t he Vi ew menu
( see 6. 11.7 Creat i ng wi ndow inst ances) . When creat i ng a new Agent wi ndow, you are
asked for t he number of t he agent slot t o be shown. Thi s number can l at er be changed in
t he Agent wi ndow usi ng t he numeri c up/ down cont rol . Pressi ng t he up/ down keys or
but t ons provi des f ast browsi ng t hrough al l agent s.

Most fi el ds i n t he Agent window direct l y correspond t o Agent dat a seri es. I n addi tion, the
agent s amount of cash and t he number of shares i t hol ds in i t s port foli o (long or short )
ar e shown.

6.9.1 Showing an agents genome
By cli cki ng on t he but t on Show genome i n an Agent wi ndow, the agent s genome ( i t s
t radi ng rul e) can be shown. Thi s i s mostl y for illust rat i ve purposes and t o get a gener al
i mpressi on of t he genomes and t heir st ruct ure. Not e t hat i n general , geneti c programs
ar e not meant t o be read by peopl e. They oft en seem il logi cal and i nef fi ci ent , if not
i ncomprehensibl e. For underst andi ng t he genomes i t i s necessary t o read I I I . Genet i c
programmi ng in Adapt i ve Model er. The genomes are wri t t en as s- expr essions t hat are
format t ed wi t h ext r a t abs and line breaks t o show t hei r hi erarchi cal st ruct ure. Every
col umn corresponds wi t h a hi erarchi cal l evel of t he genomes t ree. The root node ( t he
st art of t he genome) i s shown at t he t op l eft ( fi rst col umn) . I t s argument nodes ar e
shown bel ow each ot her in t he second column. Thei r argument nodes ar e shown in the
t hi rd column, et c. Nodes of t he same l evel are aligned exact l y bel ow each ot her. ( I f t he
wi ndow were t o be rot at ed 90 cl ockwi se, t he hi er archi cal st ruct ure woul d be shown in a
t op- down ori ent at ion wi th t he nodes bei ng ri ght - al i gned ).

Not e: Whi l e vi ewing an agent s genome during model evol ution, t he agent may be
repl aced by anot her agent i n t he meant i me. I n t hat case, no warning or indi cat i on i s
gi ven and t he ol d genome i s st ill being shown as l ong as t he genome wi ndow i s open. To
prevent t hi s, pause t he model before vi ewing an agent genome.

6.10 Logger
The logger st ores vari ous non- cri ti cal not ifi cat i ons t hat are being generat ed during model
evol ution that may be of int erest t o t he user. The meaning of speci fi c notifi cat i ons i s
expl ai ned el sewher e in t hi s Users Gui de in t he rel evant sect i ons.

The logger shows noti fi cat i ons i n ascending order of t hei r l og ti me, meani ng t hat t he
most recent noti fi cat i on i s al ways at t he bot t om. Scroll up t o see earli er noti fi cat ions. To
have t he logger al ways show t he most recent not ifi cat i on, pl ace t he cursor i n t he most
recent not i fi cat i on. To keep showing anot her ( earli er) noti fi cat ion, pl ace t he cursor i n t he
desi red noti fi cat i on. Then t he l ogger will not j ump t o new notifi cat ions. I t may be hel pful
t o pause model evoluti on whil e browsi ng t hrough t he l ogger.

71
6.11 Customizing the User Interface
Adapt i ve Model er offers a cust omi zabl e user i nt erface t hat enabl es you t o rearrange
wi ndows as desi red. The arrangement of windows (i ncl uding user cr eat ed window
i nst ances) ar e par t of t he St yl e.

6.11.1 Showing a window
A window can be shown by sel ect i ng i t in t he Vi ew Menu. Some i t ems in t he Vi ew menu
have a submenu. These ar e for window t ypes for whi ch mul tipl e inst ances can be
creat ed. For i nst ance i t i s possi bl e t o creat e mul t i pl e Chart s wi ndows. To show a
wi ndow of a mul ti pl e-inst ance t ype, first open i ts submenu and t hen sel ect t he i nst ance
t o be shown. I f no i nst ances exi st in t he submenu, t hen sel ect Cust omi ze t o creat e a
new i nst ance window.

6.11.2 Maximizing a window
A window can be maxi mi zed by cli cki ng on t he maxi mi ze but t on near t he t op- ri ght corner
of the wi ndow ti tl e bar. A window can al so be maxi mi zed t hrough it s cont ext - menu
( ri ght - cli ck on the wi ndows t ab or ti tl e bar) . Maxi mi zi ng a window will make all ot her
wi ndows invi si bl e unt il t he maxi mi zed window i s de- maxi mi zed ( rest ored) agai n by
cli cki ng on the de- maxi mi ze but t on or by cl i cki ng Rest ore in the wi ndows cont ext -
menu. A window can al so be maxi mi zed or de- maxi mi zed by doubl e cl i cki ng on the
wi ndow ti tl e bar.

6.11.3 Hiding or closing a window
A window can be hi dden ( closed) by cli cking on it s exi t but t on i n the t op- ri ght corner of
t he t i tl e bar, by desel ect i ng i t i n t he Vi ew menu or through i t s cont ext - menu ( right - cli ck
on t he wi ndows t ab or ti tl e bar) . Hi ding a window does not del et e anyt hing, i t j ust cl oses
t he wi ndow until i t i s opened agai n. A hi dden window can be shown agai n t hrough the
Vi ew menu.

6.11.4 Resizing windows
Windows can be resi zed by moving t he hori zontal or vert i cal spli t t ers t hat exi st bet ween
wi ndows.

6.11.5 Moving windows
A window can be moved t o anot her l ocat i on by dragging and dropping i t by i t s ti tl e bar.
( Tabbed wi ndows can al so be dragged by t hei r tab) . Whil e dragging a window across t he
scr een, a shaded ar ea will mark t he new l ocat i on t he window wi ll get when i t i s dropped.
When a full window i s shaded, t he dr agged window will appear as a t ab of t he shaded
wi ndow. When onl y part of a wi ndow i s shaded, t he wi ndow area will be spli t in t wo part s
t o show t he dragged wi ndow and the shaded window t oget her.

6.11.6 Reordering tabs
Window t abs can be reorder ed by dragging and droppi ng t hem t o anot her l ocat i on in t he
t ab bar bel ow the wi ndow.

6.11.7 Creating window instances
Cert ai n wi ndow t ypes such as Char t s , Popul at i on and Agent are mul ti pl e-i nst ance
t ypes. Thi s means t hat sever al inst ances of t hese window t ypes can co- exi st at t he same
t i me, provi ding more fl exi bi lit y t o vi ew vari ous dat a si mul t aneousl y. To creat e a mul ti pl e-
72
i nst ance t ype wi ndow, first open the t ypes submenu i n t he Vi ew menu and t hen sel ect
Cust omi ze . A wi ndow will appear t hat li st s all t he exi st i ng windows of t hat t ype ( i f
any) . Cli ck Add t o creat e a new inst ance. Depending on t he window t ype you will be
asked for a name for the i nst ance or any ot her paramet er val ues. Aft er cl i cki ng OK t he
i nst ance window will be creat ed and appear i n the l i st .

6.11.8 Deleting a window instance
To del et e a wi ndow inst ance of a mul t i pl e-inst ance window t ype, open t he windows
cont ext menu ( right - cli ck on the wi ndows t i tl e bar or t ab) and cl i ck Remove .
Al t ernat i vel y, open the t ype s submenu in t he Vi ew menu, sel ect Cust omi ze , sel ect
t he i nst ance t o be del et ed in t he li st and cli ck Del et e .

6.11.9 Renaming a window instance
To rename a window i nst ance of a mul ti pl e-inst ance window t ype, open t he windows
cont ext menu ( right - cli ck on the wi ndows t i tl e bar or t ab) and cl i ck Rename .
Al t ernat i vel y, open the t ype s submenu in t he View menu, sel ect Cust omi ze , sel ect
t he i nst ance t o be renamed in t he li st and cl i ck Rename .

Not e t hat not al l mul ti pl e-inst ance wi ndow t ypes can be renamed. For i nst ance, t he
names of Agent wi ndows are aut omat i call y set t o Agent n where n i s t he number of
t he agent sl ot bei ng shown.

6.12 Styles
A St yl e i s a coll ect i on of user int erface set t i ngs such as t he sel ect ion of dat a seri es i n
Chart s wi ndows and t he Current Values window and various ot her present at i on el ement s
such as window arrangement . Al so t he Performance Cal cul ati on Set t i ngs and some
export set t i ngs are part of t he st yl e. When a model i s being saved, i t s st yl e i s
aut omat i cal l y incl uded i n t he model fil e so t hat when t he model i s re- opened, t he st yl e i s
aut omat i cal l y rest ored.

I t i s al so possi bl e t o save a model s st yl e as a separ at e St yl e fil e ( ext ension * . aps) whi ch
makes i t possi bl e to appl y t he st yl e t o any ot her model . Thi s makes i t easy t o appl y a
part i cul ar st yl e t o mul ti pl e model s wi thout havi ng t o recreat e t he st yl e for ever y new
model . Savi ng and appl ying st yl es can be done wi th t he Save St yl e and Appl y
St yl e commands i n t he Fil e menu.

A st yl e onl y cont ai ns el ement s t hat affect t he present at i on of a model , not i t s cont ent s or
par amet er s. Appl ying a st yl e t o a model does not i n any way affect t he st at e or evolut ion
of the model . However, keep i n mi nd when applyi ng another st yl e t o a model , t hat t he
export set t i ngs may change t oo and t hat t he hi st ory of any non- recomput abl e dat a seri es
wi ll be l ost ( see 8.4 Recomput abl e vs. non-recomput abl e dat a seri es) . When using non-
recomput abl e dat a seri es, i t i s recommended t o save t he model before ( t emporari l y)
appl yi ng anot her st yl e so t hat t he model ( wi th the origi nal st yl e and hi st ory) can be
rest ored by revert i ng t o t he saved model .

6.12.1 Default style
The defaul t st yl e t hat will aut omat i call y be appl ied t o new model s can be speci fi ed in t he
Opt ions di alog box from t he Tool s menu. Any vali d st yl e fi l e can be ent ered her e,
i ncluding user creat ed st yl es. Adapt i ve Model er comes wi t h a f ew pre- defined st yl es.
These are locat ed i n t he St yl es fol der in t he appli cat ions program f older.

73
6.13 Computation performance issues

Model evol uti on speed depends on vari ous fact ors such as t he popul ati on si ze, t he
aver age genome si ze and dept h, t he evol ution par amet er s and t he gene sel ect i on. For
i nst ance, t he Techni cal I ndi cat or genes gener ally require more comput at ion ti me t han
most ot her genes. Al so, some gene sel ect ions may resul t i n very sl ow creat i on of t radi ng
rul es ( but t hi s can be t est ed in advance wi th t he Genome Creat i on and Mut at ion Test er) .

Al so the St yl e has an ef fect on evol uti on speed. Gener al l y, model evol uti on i s fast est
when al l Chart s, Popul ation, Agent and Performance windows are cl osed or ot herwi se not
vi si bl e. I f a Chart s wi ndow i s vi si bl e, longer chart peri ods may requi re more comput ing
t i me t han short er chart peri ods. I f t he Performance Overvi ew i s vi si bl e, many sub peri ods
and/ or long cal cul ati on peri ods may requi re more comput i ng ti me.

Cert ai n dat a seri es such as St at i st i cal Si mul ations can requi re a l ot of comput ing ti me
dependi ng on thei r paramet er s.

Running mul ti pl e inst ances of Adapti ve Model er si mul t aneousl y ( ei t her manuall y or by
usi ng bat ch mode) wil l ful ly uti li ze mul tipl e CPUs or mul ti - core CPUs i f present .

74
7. Trading

7.1 Evaluating forecasting success
When revi ewi ng t he f orecast i ng abili ti es of a model , in part i cul ar t he Forecast Di rect i onal
Accuracy should be exami ned. Values above 50% indi cat e t hat more oft en t han not t he
di rect i on of pri ce change was forecast ed correct l y. The Forecast Di rect ional Area Under
Curve indi cat es t o what ext ent any f orecast i ng accur acy i s caused by act ual predi ct i ve
abi li ti es or si mpl y by luck or bi ased dat a. Al so t he Forecast Di rect i onal Si gni fi cance
shoul d be t aken i nt o account .

Ot her dat a seri es t o j udge f orecast accuracy are t he Forecast Error , Mean Absolut e Error,
Mean Squared Error, Root Mean Squared Error and Ri ght / Wrong Forecast ed Pri ce
Changes.

To conclude whet her or not a model has acqui red si gnifi cant f orecast i ng abili ti es, a
suf fi ci ent number of quot es should have been processed f or st at i st i cal si gnifi cance. Oft en
a model wi ll show peri ods of good forecast i ng alt ernat ed wi t h periods of poor forecast i ng.
The user should eval uat e whet her or not a model has acqui red suffi ci ent forecast i ng
abi li ti es overall . The Trading Si mul at or can be of hel p in t hi s process but be awar e t hat
t he performance of t he Tradi ng Si mul at or i s al so affect ed by f act ors ot her t han t he
model s forecast i ng success. These f act ors i ncl ude t he securi t ys vol at i li t y, broker
commi ssi on, spreads, and ot her Trading Syst em paramet ers. When t hese fact ors are
unfavorabl e t he Trading Simul at or can have ver y poor ret urns even when forecast
accur acy i s high. I t i s t herefore recommended t o al so use t he St at i st i cal Si mul ations t o
observe t he effect s of different val ues for t hese fact ors on t he pot enti al ret urns.

7.2 Using the Trading Simulator
The Tradi ng Si mul at or si mul at es t r adi ng based on t he t radi ng si gnal s. I t shows you what
ret urns woul d have been made from act uall y t radi ng accordi ng t o the t radi ng si gnal s
during a previ ous peri od and/ or what ret urns ar e bei ng made present l y if t he t rades are
act uall y execut ed. The broker commi ssi ons, spread and sli ppage as speci fi ed in t he
Trading Syst em Par amet ers are t aken i nto account by t he Tradi ng Si mul at or. However,
small di fferences bet ween t he way t he syst em admini st ers t r ades and t he act ual
execut ion of t rades may cause di fferences bet ween t he Tradi ng Si mul at or and reali t y. I t
i s t herefore i mport ant t o ent er accurat e val ues f or the Tradi ng Syst em par amet ers i f t he
Trading Si mul at or i s t o gi ve a cl ose represent at ion of reali t y. See 3.2.2 Tradi ng Si mul at or
for det ail s on how t rades are si mul at ed. See I .3. 2 Trading Si mul at or for a descri pt ion of
Trading Si mul at or dat a seri es.

The Performance Over vi ew (accessi bl e t hrough the Vi ew menu) offers ext ensi ve
possi bi li ti es t o anal yze t he Tradi ng Si mul at ors performance usi ng various ri sk and ret urn
i ndi cat ors. For more informat i on see 6.7 Performance Over vi ew.

The Tradi ng Si mul at or can be enabl ed or di sabl ed. Di sabli ng t radi ng i s part i cul arl y useful
at t he st ar t of a new model when t he model has not yet acqui red any consi st ent
forecast i ng skill s. For thi s reason t radi ng i s di sabl ed by def aul t at t he st art of a new
model . You shoul d deci de whet her or not t o enabl e t he Trading Si mul at or, af t er
eval uat i ng whet her suffi ci ent forecast i ng skill s have been demonst rat ed by t he model .

Not e t hat t he val ue of an exi sti ng short posi tion will become l ess t han - 100% when t he
securi t y pri ce i ncreases. The Tradi ng Si mul at or does not si mul at e any margin
mai nt enance requi rement s and t here i s no limi t t o t he allowed l ever age of an exi sti ng
posi ti on. Thi s does obvi ousl y not conform t o real i t y. However, i n most cases t he Tradi ng
Si mul at or woul d need t o hold a short posi tion for a rel at i vel y long period of ti me before
t he val ue of t he short posi tion woul d exceed reali sti c margi n mai nt enance r equi rement s.

75
I t i s assumed t hat i t i s possi bl e t o t rade t he securi t y at or near t he l ast pri ce on whi ch
t he si gnal was based. For exampl e, when using hourl y quot es, a si gnal t hat was
gener at ed based on t he 10am quot e will be avai l abl e shortl y aft er 10am ( aft er t he quot e
has been recei ved and t he forecast s has been cal cul at ed) . Any t rade ( si mul at ed or real )
based on t hi s si gnal will obviousl y occur l at er t han 10am and t he market pri ce may t hen
have changed si nce 10am. The sli ppage par amet er on t he Tradi ng Syst em t ab of t he
Model paramet ers di alog box can be used t o speci fy t he average expect ed change in
pri ce. Thi s paramet er wi ll be used by t he Tradi ng Si mul at or ( and by t he St at i st i cal
Si mul ations) t o cal cul at e t he order execut i on price. Sl i ppage wi ll not be a probl em as
l ong as t he difference i n pri ce i s small compared t o t he aver age expect ed quot e int erval
vol at i li t y. However, when usi ng dail y quot es for securi ti es whose pri ce mi ght be af fect ed
by overni ght event s such as t r adi ng i n rel at ed securi ti es in ot her geographi c regi ons, t he
next days openi ng pri ce coul d be st ruct urall y different t han l ast day s cl osi ng pri ce.

7.3 Statistical Simulations
Whi l e t he Trading Si mul at or offers i nsi ght int o t he past and present performance of
t radi ng based on a part i cul ar model s forecast s, i t does not gi ve insi ght int o the pot ent i al
range of ( fut ure) ret urns of mul ti pl e model s ( runs) and i t s sensi t i vi t y t o influenti al fact ors
such as vol atili t y and Forecast Di rect ional Accuracy.

I t i s i mport ant t o reali ze t hat fut ure ret urns can end up anywhere wi t hi n a range
det ermi ned by t he val ues of such fact ors ( gi ven a cert ai n l evel of confi dence) . So even i f
all fact ors are bei ng consi dered t o remai n const ant , fut ure ret urns are st ill subj ect t o a
cert ai n range. Obviousl y i t i s i mport ant t o know t hi s range. Furt hermore, i f one or more
fact ors ar e goi ng t o change in t he fut ure, t he range of fut ure ret urns coul d change
dramat i call y.

Wi th t he st at i st i cal si mul ations incl uded in Adapt i ve Model er, you can st udy t he l i kel y
range of ret urns and i t s sensi ti vi t y t o changes i n i t s underl ying fact ors. The si mul at i on
t ool s i ncluded are Hi st ori cal and Mont e Carl o simul at ions. Bot h are i mpl ement ed as dat a
seri es and ar e furt her descri bed i n I .3. 3 St at i st i cal Si mul ati ons.

76
8. More about data series

Thi s chapt er di scusses some general i ssues about dat a seri es. All i ndi vi dual dat a seri es
ar e descri bed i n det ail in Appendi x I .

8.1 Parameters

Some dat a seri es have par amet ers. When addi ng a dat a seri es wi t h paramet ers t o a
chart or Current Values window, a di alog box appears al lowi ng you to ent er paramet er
val ues. ( For some dat a seri es t he paramet er di alog box does not appear aut omat i cal l y
but can be opened t hrough the cont ext menu aft er t he dat a seri es has been l aunched) .

To change t he paramet er val ues of an exi st i ng dat a seri es i n a chart , act i vat e t he cont ext
menu of t he chart ( by cli cki ng t he right mouse but t on), sel ect t he dat a seri es and t hen
sel ect Par amet er s .

To change t he paramet er val ues of an exi st i ng dat a seri es i n t he Current Values window,
move t he mouse t o t he row cont aini ng t he dat a seri es, act i vat e t he cont ext menu ( by
cli cki ng t he ri ght mouse but t on) and sel ect Paramet ers .

For most par amet ers, mi ni mum and maxi mum val ues appl y. When you ent er an i nvalid
val ue, t he par amet er will be reset t o t he l ast used val i d value when you l eave t he fi el d or
cli ck OK .

Once t he dat a seri es has been added t o a char t or the Current Values wi ndow, t he values
of it s par amet er s will be shown behind i t s name.

Paramet ers can be a cal cul at ion peri od, cal cul at ion met hod or ot her speci fi c paramet ers.

8.1.1 Calculation period
For some dat a seri es you can set t he cal cul at ion peri od. The cal cul at ion peri od defi nes
t he hi st ori cal dat a t hat will be used for cal cul ati ng t he dat a seri es val ues. Thi s i s rel evant
for ret urns, FDA and ot her values t hat can be cal cul at ed over a hi st ori cal period.
Dependi ng on the part i cul ar dat a seri es and where i t i s being shown, t he fol lowi ng
cal cul at ion period modes can be avail abl e:

Trailing n bar s
The cal cul at i on peri od i s al ways t he l ast n bars and t hus moves forward wi t h every new
processed bar. ( The l engt h of t he cal cul at ion period st ays fi xed) .

Trailing n periods
The cal cul at i on peri od i s al ways t he l ast n periods of t he speci fi ed si ze and t hus moves
forward wi t h ever y new processed bar. ( The l engt h of t he cal cul at i on period st ays f i xed) .
Not e: t he speci fi ed period si ze here i s NOT used as t he compounding peri od. When a
compoundi ng period needs t o be speci fi ed, t hi s is done ei ther in t he Cal cul ati on met hod
or wi th a separat e Compounding Peri od paramet er.

Since model st art
The cal cul at i on peri od st ar t s wi t h t he model evoluti on st art bar and ends wi t h t he current
bar. ( The cal cul ati on period expands wi t h model evol ution) . For Trading Si mul at or dat a
seri es, t hi s mode i s i rrel evant and t herefore not avail abl e.

77
Since Trading Simulat or st art
The cal cul at i on peri od st ar t s wi t h t he Trading Simul at or st art bar and ends wi t h t he
current bar. (The cal cul ati on period expands wi t h model evol ution) . The Trading
Si mul at or st art bar i s t he fi rst bar at whi ch t he Tradi ng Si mul at or became enabl ed during
model evol ution ( regardl ess of how of t en t he Tradi ng Si mul at or was di sabl ed or enabl ed
agai n l at er) .

Since date
The cal cul at i on peri od st ar t s at t he speci fi ed dat e/ t i me and ends wi t h t he current bar.
( The cal cul at ion peri od expands wi t h model evolution) .

Fixed date range ( From t o )
The cal cul at i on peri od st ar t s at t he speci fi ed st art dat e/ t i me and ends at t he speci fi ed
end dat e/ t i me. ( The cal cul at ion period nei ther expands nor moves wi t h model evolut ion) .

These modes ar e avail abl e when showing a dat a seri es i n t he Current Val ues wi ndow. I n
chart s, for most dat a seri es onl y t he t rail ing modes can be used because i t wouldnt
make sense t o use an expanding cal cul at i on period or a fi xed dat e range i n a chart .
( There ar e some except i ons such as t he dat a seri es ( TS) Ret urn, TS Maxi mum
Drawdown, Hi st ori cal Si mul at i on and Ret urn Di st ri bution) .

When a cal cul at i on period i s speci fi ed that st art s before t he model st art bar or before t he
Trading Si mul at or st ar t bar, t he dat a seri es may ret urn no val ue si nce not enough dat a i s
avail abl e. Al so, i f t he cal cul at ion period st art s or ends aft er t he current model bar, t he
dat a seri es ret urns no val ue.


8.1.2 Calculation method
For some dat a seri es ( i .e. Ret urn and TS Ret urn) t he cal cul ati on met hod can be speci fi ed.
The fol lowing met hods are possi bl e:

Cumulat ive
The cumul at i ve ret urn over t he cal cul at ion peri od i s cal cul at ed.

Compounded
The ret urn over t he cal cul at i on period i s compounded t o t he speci fi ed compounding
peri od si ze. ( The compoundi ng period si ze may be di fferent t han t he period si ze used for
t he Trail ing n periods cal cul ati on period mode) .

8.1.3 Compounding period
Some dat a seri es have a Compounding period par amet er ( ei t her as par t of t he
Cal cul at i on met hod or as a separ at e par amet er) . The compoundi ng period indi cat es t he
peri od l engt h (i.e. day, mont h, year) t o whi ch val ues such as r et urn or vol atil i t y should
be compounded ( convert ed) . Thi s al lows easy compari son of di fferent dat a seri es even
when t hei r out put i s based on di fferent hi st ori cal period l engt hs.

The Compoundi ng peri od paramet er i s set t o Year by def aul t .

Some dat a seri es ( i .e. Ret urn) will not ret urn a val ue i f not at l east 75% of one
compoundi ng period of hi stori cal dat a i s avail abl e in t he cal cul at i on period. Thi s i s to
ensure t hat ret urns ar e not bei ng compounded t o periods t hat ar e much l onger t han t he
peri od over whi ch they wer e cal cul at ed, whi ch would produce unrel i abl e resul t s. For t hi s
reason i t may be useful t o sel ect a short er compounding peri od (i .e. day or month) when
worki ng wi t h small quot e int erval s t hat requi re a ver y l arge number of bars t o fill a year.

St at i st i cal Si mul ation dat a seri es may be compounded t o any period. However,
i nadequat el y chosen combinat ions of cal cul at i on period, compounding peri od, number of
78
si mul ati ons and invest ment hori zon may produce st at i st i cal l y unreli abl e or ext reme
( t hough correct ) resul t s. See al so t he document at i on of t he Si mul ation dat a seri es.

Not e t hat for compoundi ng dat a seri es t o ot her periods t he Market Trading Hours set t i ngs
ar e used t o cal cul at e t he number of peri ods. Hi st ori cal changes of t he Market Tradi ng
Hours are bei ng recorded and are used t o cal culat e t he number of act ual periods (by
t radi ng t i me) during t he cal cul at ion period for accurat e cal cul at i on of ret urns, vol atili t y
and ot her i ndi cat ors. Nevert hel ess, i ncorrect Market Tradi ng Hours set t ings as wel l as
frequent l y mi ssing bars can cause ( sl i ght ) di st ort ions i n compoundi ng conversi ons.
Changes i n Market Tradi ng Hours al so may cause sli ght di st ort ions around t he ti me when
t he change occurred in compounded dat a seri es.

8.2 Moving Averages

For most dat a seri es i t i s possi bl e t o add a moving average. A moving aver age wi ll
appear as a separ at e dat a seri es i n t he chart or Current Val ues wi ndow that cont ai ns i t s
source.

To add a moving aver age, act i vat e t he cont ext menu of t he source dat a seri es ( i n a chart
or the Current Val ues wi ndow) and sel ect Add moving aver age . ( I f i t i s not possi bl e to
sel ect Add moving aver age t hen t hi s dat a seri es can not have a moving aver age) . A
di alog box will appear aski ng for the number of hi st ori cal bars ( val ues) t hat shoul d be
i ncluded in t he movi ng aver age cal cul ati on.

When adding a movi ng aver age seri es t o a chart , al so an opti on t o hide t he source dat a
seri es i s avail abl e. I f t hi s option i s checked, t he source dat a seri es will still exi st i n t he
chart but wont be vi si bl e. I t i s st ill possi bl e t o access t he source dat a seri es t hrough t he
chart cont ext menu, for inst ance for changi ng i ts par amet ers ( whi ch wi ll be refl ect ed i n
t he moving average seri es as well ) or for creat i ng addi ti onal movi ng aver ages. To make
t he source dat a seri es vi si bl e agai n, open t he Par amet er s di alog box of the movi ng
aver age seri es and uncheck Hi de source.

The name of t he movi ng aver age dat a seri es above t he chart wi ll be t he name of i t s
source followed by MA ( n) where n i s t he number of hi st ori cal bars. A movi ng aver age
can onl y exi st t oget her wi t h i t s source. I f t he source dat a seri es i s removed, t he movi ng
aver age i s al so removed.

8.3 Autocorrelation
For some dat a seri es i t i s possi bl e to add an aut ocorrel at ion indi cat or. Li ke a movi ng
aver age, an aut ocorrel at i on indi cat or will appear as a separ at e dat a seri es i n t he chart or
Current Val ues wi ndow t hat cont ai ns i t s source. Aut ocorrel at ion i ndi cat ors ar e avail abl e
for dat a seri es such as Volume, Bar Ret urn, Singl e Bar FDA, Forecast Error and some
ot hers.

To add an aut ocorrel at ion indi cat or, act i vat e t he cont ext menu of t he source dat a seri es
(i n a chart or t he Current Val ues wi ndow) and sel ect Add aut ocorrel at i on . ( I f i t i s not
possi bl e t o sel ect Add aut ocorrel at ion t hen thi s dat a seri es can not have an
aut ocorrel at ion i ndi cat or). A di al og box wi ll appear aski ng for the l ag and t he number of
hi st ori cal bars t hat should be incl uded in t he aut ocorrel at i on cal cul at ion. As for movi ng
aver ages, when addi ng an aut ocorrel at ion i ndi cat or t o a chart , an opti on i s avail abl e t o
hi de t he source dat a seri es. Thi s i s especi al l y useful for aut ocorrel at ion indi cat ors
because t he val ue range of t he source dat a seri es may be compl et el y di fferent t han t he
range of aut ocorrel at ion val ues ( whi ch range from - 1 t o 1) whi ch woul d make t he
aut ocorrel at ion i ndi cat or dif fi cul t to see i n the chart .

The name of t he aut ocorrel ati on dat a seri es wi ll be t he name of i t s source followed by
AC ( k,n) where k i s t he l ag and n i s t he number of hi st ori cal bars. An aut ocorrel at ion
79
seri es can onl y exi st t oget her wi th i t s source. I f t he source dat a seri es i s removed, t he
aut ocorrel at ion seri es i s al so removed.

For a source dat a seri es wi t h values X
t
where t is t he bar number, wi t h mean and
st andard devi at i on , t he aut ocorrel at ion wi t h l ag k and n the number of hi st ori cal bars
t o incl ude in the sampl e, i s cal cul at ed as:

2
1


n
) X ) ( X (
) n , k ( at ion Aut oCor r el
n
t
t k t
=


=

8.4 Recomputable vs. non-recomputable data series

Recomput abl e dat a seri es are dat a seri es whose hi st ori cal val ues can be comput ed at a
l at er t i me. Non- recomput abl e dat a seri es can onl y be comput ed i n real - ti me meani ng
t hat i t i s not possi bl e to comput e hi st ori cal val ues from before t he ti me t he dat a seri es
was st art ed. The reason t hat some dat a seri es are non- recomput abl e i s t hat some
i nt ernal model dat a i s onl y bei ng cal cul at ed i n real - ti me wi t hout recording t he hi stori cal
val ues ( t o save memory) . Anot her reason i s that some dat a seri es depend on dat a t hat
may change duri ng model evol uti on al t hough t he hi st ory of t hese changes i s not bei ng
recorded. Changes t o model paramet er s duri ng model evoluti on ( by t he user) ar e an
exampl e of t hi s.

Obvi ousl y, i f you want t o be abl e t o moni t or t he ent i re hi story of a non- recomput abl e
dat a seri es, t he dat a seri es shoul d be added t o a chart from t he st art of model evoluti on.
Not e t hat when a par amet er of a non- recomput abl e dat a seri es i s changed, i t s hi st ory
wi ll not be recal cul at ed and st ill refl ect t he ori ginal paramet er set t ing. Non- recomput abl e
dat a seri es can not have a movi ng average or aut ocorrel at i on indi cat or.

Adding a recomput abl e dat a seri es during model evolut ion or changing i t s paramet er s
requi res ( re)cal cul at i on of t he dat a seri es hi st ory. Thi s may t ake some t i me for some
dat a seri es. ( Re) cal cul at i on and (re) drawi ng of the dat a seri es t her ef ore t akes pl aces as a
background process whil e model evolution continues.


8.5 Memory limitations
Adapt i ve Model er does not st ore an i nfini t e number of hi st ori cal bars ( nei ther in memory
nor on di sk) . For performance reasons t he number of hi st ori cal bars for dat a seri es and
ot her int ernal dat a t hat can be st ored i s li mi t ed t o a maxi mum. The maxi mum number of
bars st ored i s 100,000
39
.

Aft er t he maxi mum number of st ored bars has been exceeded, a model continuous t o
evol ve but t he ol dest bar s will be overwri t t en by new bars so t hat al ways onl y t he l ast
100,000 bars remai n in memory. Chart s t herefore onl y show the l ast 100,000 bars of
dat a seri es.

Rel at ed t o t hi s, some dat a seri es do not ret urn val ues anymore when t hei r cal cul ati on
peri od i s set t o Since model st art or Since Tradi ng Si mul at or st art and t he requi red
model hi st ory i s no l onger compl et el y i n memory. I n t hat case, a t r ail ing cal cul at i on
peri od can be used wi t h t he number of bars set t o maxi mum. Not e t hat t he securi t y pri ce
j ust before model st art and j ust bef ore Tradi ng Syst em st ar t ar e al ways r emember ed so
all the ret urn dat a seri es t hat need j ust t hese can al ways be cal cul at ed.


39
20,000 for t he Eval uat i on Edi ti on.
80
Li kewi se, t he Agent Cumul ati ve Excess Ret urn can not be cal cul at ed when t he bar j ust
before agent creat i on i s no longer in memory. For The Agent Repl acement Fi t ness Excess
Ret urn, t he securi t ys ret urn i s cal cul at ed si nce t he oldest bar in memory i n case t he bar
j ust before agent cr eat i on i s no longer i n memory. ( I n gener al i t i s very rar e t hat an
agent s age exceeds t he maxi mum number of st ored bars).

I n case a model exceeds t he maxi mum number of st ored bars, i t mi ght be useful to save
an ext r a copy of t he model ever y 100,000 bars and i nclude t he begin/ end dat es of t he
peri od covered in t he fil ename, so t hat t he ent i re hi st ory of t he model i s preser ved.

81
9. Exporting data

Dat a seri es can be export ed t o a CSV fi l e ( Comma Separ at ed Values) whi ch can t hen be
i mport ed by ot her appli cat ions for furt her processi ng or research. Dat a can be export ed
manuall y or aut omat i call y ( real - ti me) .

Exporting dat a makes i t possi bl e to int egrat e Adapt i ve Model er i n a wi der set of t radi ng
soft war e t o provi de addi tional functional i t y such as:
- si mul ati ng more compl ex t r ading st rat egi es ( i .e. invol vi ng deri vat i ves)
- aut omat ed t r ading (online order pl acement )
- cal cul at ing ot her t radi ng performance indi cat ors
- et c.

Al t ernat i vel y, dat a can be export ed t o ot her appli cati ons for furt her research of i.e.:
- t he behavi or of t he Agent - based Model
- t he pri ce behavi or of t he Virt ual Market ( presence of st yli zed fact s, et c. )
- t he effect s of t he genet i c operat ors on the populat i on
- et c.

To export dat a, choose Export from t he Tools menu. The Export di alog box wil l
appear.

9.1 Export Settings

9.1.1 Selecting data series to export
The Export di alog box shows a li st of al l t he dat a seri es t hat current l y exi st in Chart s
wi ndows or i n t he Current Val ues wi ndow. The dat a seri es from chart s are at t he t op of
t he l i st and t he dat a seri es from t he Current Values window are at t he bot t om. The dat a
seri es whose val ues ar e t o be export ed can be sel ect ed here by checking t hem. Not e t hat
onl y dat a seri es t hat ar e al ready present in a chart or in t he Current Val ues wi ndow can
be export ed. To export ot her dat a seri es, first add t hem t o a Chart s window or t o t he
Current Val ues wi ndow.

9.1.2 Selecting the export file
I f no export fil ename for t he model has been provi ded yet , an export fil ename will
aut omat i cal l y be suggest ed. I t i s possi bl e to ent er anot her fil ename or browse t o an
exi st i ng fil e t o export t he CSV dat a t o. I f a non-exi st i ng fil ename i s ent er ed, a new
export f il e will be creat ed. I f an exi st ing fi l e i s sel ect ed, export ed dat a wil l be appended
t o t he fil e. I f the export fil e i s goi ng t o be used si mul t aneousl y by anot her appli cat i on,
make sure t hat t he ot her appl i cat i on onl y opens t he fil e as read- only or Adapt i ve
Model er will not be abl e t o wri t e t o t he file.

9.1.3 Export historical values
Hi st ori cal val ues of t he sel ect ed dat a seri es can be export ed by checki ng Export
hi st ori cal val ues and ent eri ng the number of hist ori cal bars t o export . Aft er OK i s
cli cked, t he hi st ori cal values wil l be export ed t o t he export fil e i mmedi at el y. Not e t hat
hi st ori cal val ues can onl y be export ed for t i me dat a seri es exi st i ng in chart s and not for
di st ri bution dat a seri es or for dat a seri es from the Current Values window.

When t he number of hi st ori cal bars t o export i s ( at l east ) one hi gher t han t he number of
bars t hat have been processed so far, t he first dat a row wri t t en t o t he export fi l e i s bar
0 . Thi s i s t he bar j ust bef ore model evoluti on st art ed and can be useful to have avail abl e
82
since i t may cont ai n basel ine informat i on such as t he cl osi ng pri ce of t he securi t y before
model evol ution st ar t ed.

9.1.4 Auto Export
Sel ect Enabl e Aut o Export t o aut omat i call y export t he val ues of the sel ect ed dat a seri es
aft er every new bar has been processed. Thi s i s useful when t he export ed dat a i s going
t o be used by anot her appli cat ion i n real - ti me.

Not e: i f nei ther Auto Export nor Export hi st orical values i s sel ect ed when you cl i ck
OK , not hing wil l be export ed. However, any changes t o t he sel ect i on of dat a seri es will
be remembered (i n t he model s St yl e) whi ch for inst ance may be useful for bat ch
export i ng.

9.2 Other Export issues

9.2.1 Adding data series to the selection
I t i s possi bl e t o add more dat a seri es t o a sel ect i on t hat i s al ready bei ng used wi t hout
needi ng t o creat e a new export fi l e. The val ues of the new dat a seri es wi ll be wri t t en in
ext r a columns t o the ri ght of t he al ready exi st i ng dat a seri es in t he export fil e so t hat
t hese st ay i n the same columns. (I n t hi s case t here will be no headers for t he new dat a
seri es) . Of course i t i s al so possi bl e to speci fy a new export fil e and export t he hi st ori cal
val ues t o have a new export fil e that cont ai ns al l val ues of all t he sel ect ed dat a seri es.
The advant age of t hi s i s t hat t he header row wi ll cont ai n t he names of al l t he dat a seri es
and t hat t he dat a seri es wi ll appear in t he same order in the export f il e as i n t he li st in
t he Export di al og box.

9.2.2 Removing data series from the selection
When dat a seri es ar e bei ng removed from t he export sel ect i on, their values wil l no longer
be wri t t en t o t he export fil e. I nst ead, empt y values will be wri t t en t o t he corresponding
col umn( s) in t he export fil e. Thi s i s done t o preserve t he col umn orderi ng of t he
remai ning dat a seri es. When a removed dat a seri es i s l at er re- added agai n to t he
sel ect i on, i t s values will be pl aced in i t s ol d col umn again in t he export fil e.

Removi ng a dat a seri es from a chart or t he Current Val ues wi ndow whil e i t i s part of t he
export sel ect i on, will have t he same effect as removing t he dat a seri es from t he export
sel ect i on.

9.2.3 Exporting distribution data series
When a di st ri but ion dat a seri es i s sel ect ed for export , onl y t he mean value of t he
popul ation wi ll be export ed. As di st ri bution dat a seri es onl y ret urn dat a for t he current
bar, no hi st ori cal val ues can be export ed.

9.2.4 Styles
Most of t he export set t i ngs of a model are part of t he model s St yl e. Thi s means t hat
t hese export set t ings are aut omat i call y saved wit h a model and t hat t hey can be
separat ed from a model by savi ng t he St yl e and appli ed t o any ot her model . However,
t he export fil ename and t he set t i ng Export hi st ori cal val ues ar e not part of t he St yl e
and will t herefore not be appli ed to ot her models. When a st yl e i s appl i ed t o a model , t he
export f il ename will automat i call y be creat ed by appending _export _n.csv t o t he model
name, where n i s 1 or the small est unused number if ot her export fil es for t he same
model al ready exi st .

83
9.2.5 At what point in the Agent-based Model cycle are values exported?
Exporting al ways t akes pl ace ri ght aft er t he forecast for t he new bar has been cal cul at ed.
Thi s means t hat t he val ues of some dat a seri es al ready correspond t o t he upcomi ng bar
( for whi ch t he securi t ys pri ce i s not avail abl e yet ) whil e ot hers correspond t o t he l ast
compl et el y processed bar ( for whi ch t he securi t ys pri ce has been i mport ed al ready).
However, all val ues are wri t t en t o t he same row whi ch st ar t s wi t h t he bar number of the
l ast compl et el y processed bar. Techni call y, t he dat a seri es whose values correspond t o
t he upcoming bar bel ong in t he next row but for pract i cal reasons t hey ar e al so wri t t en in
t he row of the l ast compl et el y processed bar.

9.2.6 Date and time values in the export file
Besi des t he bar number al so t he dat e and t i me of the bar i s wri t t en t o t he export fi l e.
Thi s i s t he dat e and t i me of t he cl ose of t he bar. Not e t hat some dat a seri es report
anot her dat e and ti me ( i n chart s or t he Current Val ues wi ndow) t han t he cl ose of t he bar.
Thi s i s not vi sibl e in t he export fil e since t he dat e and t i me i s not export ed indi vidual l y for
ever y dat a seri es. The dat e format t hat i s used for exporting dat es depends on t he Dat e
format set t i ng i n the Opt ions di alog box ( from t he Tool s menu) .

84
10. Batch processing and automation
Bat ch processing invol ves t he aut omat ed cr eat i on of mul ti pl e model s at once f or sever al
securi ti es and/ or wi th mult i pl e runs per securi t y. Adapt i ve Model er offers a bat ch
processi ng int erface t o si mpli fy t he process of st art i ng several model s based on one or
more quot e fil es and of assi gni ng a configurati on, st yl e and export set t i ngs t o t hese
model s.

For exampl e, i t i s possi bl e t o speci fy a confi gurat ion fil e and a di rect ory wi t h quot e fi l es.
Adapt i ve Model er will then creat e model s of each quot e fil e ( securi t y) i n t he di rect ory and
use t he model paramet ers from t he confi gurati on fi le. The resul t s ( final values of dat a
seri es) of t he model s can aut omat i call y be export ed t o a si ngl e export fi l e. Bat ch
processi ng can al so be useful for aut omat i ng t he creat i on of a si ngl e model using a
speci fi c configurati on and st yl e and ot her cont rol set t i ngs.

Al ready exi st i ng model s can al so aut omat i cal l y be updat ed (see 10.5 Updat i ng a model ) .

10.1 Creating a batch process
To creat e a bat ch, choose Bat ch from t he Tool s menu. The Bat ch Processi ng
di alog box will appear. Ent er t he rel evant i nformat i on in the di al og box as descri bed
bel ow. ( Before st art i ng t he bat ch, you may want t o save t he Bat ch set t i ngs ( see 10.3)
because t hey ar e not aut omat i call y saved when st art i ng a bat ch) .

10.1.1 Batch name
The bat ch name wil l aut omat i cal l y be creat ed but you can change t hi s t o somet hing more
descri pti ve. The bat ch name will be used as t he bat ch fil e name i f t he bat ch i s saved.

10.1.2 Batch description
Thi s i s an opti onal t ext fi el d t hat can be used for a descri pt ion or not es for a bat ch t hat i s
goi ng t o be saved.

10.1.3 Quote file(s)
Bat ch processes can be based on a si ngl e securi t y or on multi pl e securi t i es. I f mul ti pl e
quot e fi l es are speci fi ed (by ent eri ng a fol der name and/ or by using wil dcards (* , ?) i n
t he Quot e fil e( s) t ext box) t hen for every quot e f il e ( securi t y) t he number of model s as
speci fi ed at Model s per securi t y will be creat ed.

When usi ng mul tipl e securi ti es i t i s recommended t o onl y combi ne securi ti es of t he same
t ype in one bat ch as al l model s i n a bat ch will share t he same confi gurat ion fil e. All
model s wi ll t herefore share t he same par amet er val ues for Market Tr adi ng Hours,
Roundi ng, Broker Commi ssion, Spread, et c. which may be di fferent for different t ypes of
securi ti es.

10.1.4 Number of models per security
I t i s possi bl e t o speci fy t he number of model s t o be creat ed for each securi t y. Thi s makes
i t possi bl e t o i nst ant l y st ar t sever al model s for the same securi t y all using t he same
model confi gurat ion. The onl y di fference bet ween t hese model s i s t he random seed val ue
and t hi s allows for a more compl et e i nvest i gat i on of pot enti al resul t s for a gi ven securi t y
and model configurat ion ( see al so Runni ng mul tipl e model evoluti ons) . Not e t hat when in
t he confi gurat ion t o be used Generat e seed from cl ock i s checked, every model creat ed
i n a bat ch wil l get i t s own seed val ue generat ed from t he cl ock. I f Gener at e seed f rom
clock i s unchecked, t hen t he seed val ue assi gned t o every model i s equal t o t he user
85
speci fi ed seed val ue increased wi t h t he model s run number. Thi s will cause all model s
for a securi t y t o have consecut i ve seed numbers st art i ng from t he speci fi ed seed. Thi s
makes i t possi bl e to reproduce an ent i re bat ch using t he exact same set of random seed
val ues again.

10.1.5 Configuration
Her e you can sel ect a confi gurat ion fil e t hat shoul d be used for all model s t hat will be
creat ed by t he bat ch. I f t hi s i s l eft empt y, t he defaul t confi gurat ion will be used for al l
model s.

10.1.6 Style
Her e you can sel ect a st yl e t hat shoul d be appli ed t o all model s t hat will be creat ed by
t he bat ch. I f t hi s i s l eft empt y, t he defaul t st yl e will be appli ed to all model s.

10.1.7 Run numbers start value
The run numbers will aut omat i call y be appended t o t he model names. I t i s possi bl e t o
speci fy t he st art i ng run number. Thi s makes i t easi er t o add more model s t o an already
exi st i ng seri es of model s wi t h consecut i ve run numbers.

10.1.8 Run models until end of quote file
Sel ect t hi s opti on t o run all model s unti l t he end of t hei r quot e fil e i s reached. When t he
l ast quot e in t he quot e fil e has been processed, t he bat ch run ends. Thi s means t hat -
dependi ng on the bat ch set t i ngs t he model s final dat a may be export ed and t he model
may be paused, saved and/ or closed. I f model s ar e kept open ( or saved) , all model s
conti nue t o exi st and can be used as normal model s aft er t he bat ch run has fi ni shed.

Not e: The Eval uati on Edi tion wi ll run t he bat ch until t he del ayed processi ng of recent
quot es st ar t s and t hen fini sh t he bat ch ( and export final values, et c.) i mmedi at el y
wi thout wai ting for t he remai ning del ayed quot es in t he file t o be processed.

10.1.9 Run models for a given number of bars
Sel ect t hi s opti on t o run all model s for a speci fi ed number of bars. Aft er t hese bar s have
been processed, t he run ends . Thi s means t hat - depending on t he bat ch set t i ngs t he
model s final dat a may be export ed and t he model may be paused, saved and/ or closed.
I f model s are kept open ( or saved) , all model s conti nue t o exi st and can be used as
normal model s aft er t he bat ch run has fini shed. ( Not e t hat i f Pause model s at end of
run i s not sel ect ed, t he model s wi ll continue t o evol ve, even aft er t he end of the bat ch
run) .

10.1.10 Export data at end of run
I t i s possi bl e t o have t he fi nal values of dat a series ( val ues of t he l ast processed bar at
t he end of the run) export ed t o a si ngl e shared export fi l e. Thi s way t he resul t s (i .e.
Forecast Di rect i onal Accuracy) of all model s can easil y be compared. When t hi s f eat ure i s
used, t he sel ect i on of dat a seri es t o be export ed i s t aken from t he St yl es export set t i ngs.
There i s one except i on: if no dat a seri es have been checked for exporti ng in t he St yl es
export set t i ngs, t hen all exi sti ng dat a seri es in the St yl e wi ll be export ed. Thi s eli minat es
t he need t o sel ect dat a seri es for exporti ng in t he St yl es export set t i ngs onl y for t he
purpose of exporti ng fi nal values for a bat ch process. ( Regardl ess of t he bat ch export
set t i ngs, model dat a can al so st i ll be export ed during model evol ution usi ng Aut o Export
i f t hi s i s enabl ed in the St yl e) . Not e t hat t he model s name and t he model s random seed
val ue will al so be export ed t o t he bat ch fil e.

86
10.1.11 Save models at end of run
Check t hi s t o aut omat i call y save model s at t he end of the run. When model s are t o be
saved aut omat i call y, t he pat h t o save t he models can be speci fi ed at Locat i on . The
name of t he model i s aut omat i call y set t o t he quot e fi l e name combi ned wi th t he run
number. I f a model wi th the same name al ready exi st s i n t he sel ect ed pat h, you wil l be
prompt ed t o sel ect a pat h and/ or fil ename.

Not e: When running a bat ch of sever al model s, t he si mul t aneous saving of model s at t he
end of t he run may resul t i n sl ow syst em performance. When dat a i s being export ed at
end of run, i t may not al ways be necessary t o save model s at end of run. I nst ead, a
part i cul ar model could l at er be re- cr eat ed because t he random seed values of all model s
ar e st ored i n t he export fil e.

10.1.12 Pause models at end of run
Check t hi s t o aut omat i call y pause model s at t he end of t he run or l eave t hi s unchecked
t o keep all model s evol vi ng aft er t he end of t he bat ch run.

10.1.13 Close models at end of run
Check t hi s t o aut omat i call y close model s at t he end of t he run. Not e t hat i f Save model s
at end of run i s unchecked and Cl ose model s at end of run i s checked, all model dat a
wi ll be l ost aft er compl et i on of the bat ch (except for any export ed dat a) .



10.2 Starting a batch
Aft er all t he bat ch set t i ngs have been speci fi ed, t he bat ch process can be st art ed by
cli cki ng St art in t he Bat ch Processi ng di al og box. Thi s will l aunch all t he request ed
model s in separat e Adapt i ve Model er inst ances. The model s will appear mini mi zed in the
Windows Task Bar and evol ve in t he background. You can vi ew t he model s as desi red for
i nst ance by usi ng t he window arrangement opt ions t hat appear aft er ri ght - cli cki ng on t he
Adapt i ve Model er i con in t he Wi ndows Task Bar. ( Not e t hat vi ewi ng mul tipl e Adapti ve
Model er inst ances wi t h Chart s, Popul at ion Panels or Performance Panel s vi si bl e during
model evol ution may reduce syst em performance) .

Bat ches can be cr eat ed and st art ed in Adapt i ve Model er wi th or wi t hout a model al ready
running. I n case no model i s running yet and a bat ch i s st art ed t hat cr eat es onl y one
model , t hen t hat model will be l aunched in t he Adapt i ve Model er i nst ance t hat i s al ready
running.

10.3 Saving and opening batch settings
Bat ch process set t i ngs can be saved and reopened for fut ure use by using t he Save
and Open but t ons in t he Bat ch Processing di al og box. Not e t hat st art i ng a bat ch
does not aut omat i call y save t he Bat ch set t ings. I f not saved, bat ch set t i ngs will be l ost
aft er t he bat ch has been st art ed.

10.4 Starting a batch from the command line
Bat ch processing funct ionali t y i s al so accessi bl e t hrough t he command line. See Appendi x
I I for t he command line synt ax of Adapt i ve Model er.

87
10.5 Updating a model
An al ready exi st i ng model can aut omat i call y be updat ed form t he command line. Thi s
means t hat Adapt i ve Model er opens t he model , evol ves i t until t he end of t he quot e fil e,
saves i t and t hen exi t s. Thi s i s useful for aut omat i call y updat ing a model , for inst ance at
t he end of every day, wi t hout having t o keep t he model open all the t i me. I n part i cul ar,
t hi s i s useful when the model i s export ing t radi ng si gnal s or ot her dat a t o a . csv fil e
whi ch i s bei ng processed by ot her appli cat ions.

I f a model i s in paused st at e, t he model will st ill be updat ed. ( The model will t hen be
saved i n paused st at e agai n) . When no new ( unprocessed) quot es have been added t o
t he quot e fil e, updat ing a model has no eff ect . Be aware t hat Adapt i ve Model er
aut omat i cal l y saves t he updat ed model ( wi thout prompting) . Not e t hat Adapt i ve Model er
runs mini mi zed when updat i ng a model and automat i cal l y exi t s when fi ni shed. See
Command line synt ax for how t o use t he Updat e swi t ch on t he command line.
88
Appendices


I . Dat a seri es refer ence
I I . Command line synt ax
I I I . Genet i c programmi ng i n Adapt i ve Model er

89
I. Data series reference

I.1 Security data series

I.1.1 Price
Thi s i s t he securi t ys pri ce as t aken from t he quot e fil e. I t i s possi bl e to show Open, Hi gh,
Low, Close ( OHLC) bar s or j ust Close lines by set t i ng t he paramet er. OHLC bar s will onl y
be drawn when t here i s enough space per bar in t he chart . Thi s depends on t he sel ect ed
Chart peri od and t he chart s wi dth.

I.1.2 Bid and Ask
These are t he Bi d and Ask pri ces from t he quot e fil e. I f Bi d or Ask pri ces ar e not i ncl uded
i n t he quot e fi l e or if they ar e zero, no val ue i s ret urned.

I.1.3 Spread
Thi s i s t he di fference bet ween t he Bi d and Ask pri ce as a per cent age of t he close pri ce. I f
t here i s no Bi d or Ask pri ce or if t he Bi d or Ask pri ce i s zero, no value i s ret urned.

I.1.4 Volume
Thi s i s t he securi t ys t raded vol ume as t aken from t he quot e fil e.

I.1.5 Bar Return
These are dat a seri es for bar- t o- bar ret urns ( close- t o- close or t i ck- t o- t i ck ret urns) and
may be used for quant i t at i ve anal ysi s. For ordinary i nvest ment ( performance) ret urn
seri es, see I .1. 6 Ret urn.

I .1.5 .1 Ret urn
Thi s i s t he bar- t o- bar ret urn. The bar ret urn at bar t where P
t
i s t he closing pri ce of t he
securi t y at bar t i s:

1
1
=
t
t
t
P
P
R


Thi s dat a seri es can be used t o cal cul at e t he aut ocorrel at i on of ret urns by addi ng an
aut ocorrel at ion seri es t o t hi s dat a seri es.

I .1.5 .2 Log Return
Thi s i s t he l ogari t hmi c bar-t o- bar ret urn. The logari t hmi c bar ret urn at bar t where P
t
i s
t he cl osing pri ce of the securi t y at bar t i s:

|
|
.
|

\
|
=
1 t
t
t
P
P
ln R


90
Thi s dat a seri es can be used t o cal cul at e t he aut ocorrel at i on of l og ret urns by addi ng an
aut ocorrel at ion seri es t o t hi s dat a seri es.

I .1.5 .3 Absolute Ret urn
Thi s i s t he absol ut e bar- t o- bar ret urn and i s cal cul at ed by t aki ng t he absol ut e val ue of
t he Ret urn dat a seri es. Not e t hat Absolut e Ret urn i s a measure of vol ati lit y. Thi s dat a
seri es can be used t o cal cul at e t he aut ocorrel ation of vol atili t y by addi ng an
aut ocorrel at ion seri es t o t hi s dat a seri es.

I .1.5 .4 Absolute Log Ret urn
Thi s i s t he absol ut e logari t hmi c bar- t o- bar ret urn and i s cal cul at ed by t aking t he absol ut e
val ue of the Log Ret urn dat a seri es. Not e t hat Absol ut e Log Ret urn i s a measure of
vol at i li t y. Thi s dat a seri es can be used t o cal cul at e t he aut ocorrel at ion of vol atili t y by
addi ng an aut ocorrel at ion seri es t o t hi s dat a series.

I .1.5 .5 Ret urn Dist ribution
The Ret urn Di st ri bution dat a seri es shows a hi st ogram of t he logari t hmi c bar ret urns of
t he securi t ys pri ce duri ng t he speci fi ed cal cul ati on peri od. I n addi ti on t o the regul ar
di st ri bution seri es st at i st i cs ( mean, st dev, medi an, min and max) al so t he kurt osi s i s
shown i n t he dat a overl ay window.

I.1.6 Return
The Ret urn dat a seri es gi ves t he ret urn of t he securi t y over t he speci fi ed cal cul at i on
peri od usi ng t he speci fi ed cal cul ati on met hod.

The cumul at i ve ret urn over a cal cul ati on peri od ( s, e) where s i s t he fi rst bar of the
cal cul at ion period, e i t s l ast bar, and P
t
the cl osing pri ce of t he securi t y at bar t , i s:

1 =
s
e
P
P
R


The compounded ret urn over a cal cul at ion period ( s,e) i s:

1
1

|
|
.
|

\
|
=
Per iods
s
e
P
P
R


where Periods i s t he number of compounding peri ods bet ween s and e.

For compoundi ng peri ods t hat ar e longer t han or equal to 1 week, Periods i s si mpl y
cal cul at ed as ( t
e
- t
s
) / c where c i s t he durati on of the compounding period. For
compoundi ng periods short er t han 1 week, t he amount of market t r adi ng ti me bet ween e
and s, and t he aver age durat i on of t he compoundi ng peri od i n market t r ading ti me
( during t he cal cul at ion peri od) are t aken i nt o account in t he cal cul at ion.

I f Periods i s l ess t han 0.75, t hi s dat a seri es will ret urn no val ue.
I f t he st art of t he cal cul ati on peri od i s before model evoluti on st art , t hi s dat a seri es wi ll
ret urn no val ue.


91
I.1.7 Volatility
There ar e t wo t ypes of vol at ili t y dat a seri es:
- Wei ght ed Vol at i lit y
- Hi st ori cal Vol at ili t y

I .1.7 .1 Weight ed Volatilit y
The wei ght ed vol at i li t y i s cal cul at ed using an exponenti al l y wei ght ed movi ng average
( EWMA) of squared logari t hmi c ret urns. I t i s assumed t hat t he mean val ue of ret urns i s
zero because wei ght ed vol at ilit y i s t ypi call y used for short t erm peri ods.

The wei ght ed vol at i li t y over cal cul ati on period ( s, e) wi t h decay f act or , compounded t o
t he speci fi ed compounding period of PeriodLengt h bars i s gi ven by:

=
1
0
2
1
1
n
i
i e
i
n
r t h PeriodLeng




where n = e- s+ 1 and r
t
= ln(P
t
/ P
t - 1
).


Not e t hat in order t o incl ude suffi ci ent informat ion i nt o t he cal cul at ion, n shoul d be at
l east n
min
whi ch i s gi ven by:

) ln(
) c ln(
n
min

=
1



where c i s t he desi red confi dence l evel (i .e. 95%, 99% or 99.9%).

I f n
min
cal cul at ed using c = 99.9% i s l ess t han t he number of bars i n t he cal cul at ion
peri od t hen onl y t he requi red (most recent ) number of bars ar e i ncluded in t he
cal cul at ion. I f i t i s more, t hen only t he bars in the cal cul at i on period are used meani ng
t hat i nsuffi ci ent informat i on i s used in t he cal cul at i on.

I f t he cal cul at ion peri od cont ains l ess t han 2 bars, t hi s dat a seri es wi ll ret urn no value.
I f t he st art of t he cal cul ati on peri od i s before model evoluti on st art , t hi s dat a seri es wi ll
ret urn no val ue.

I .1.7 .2 Hist orical Volat ilit y
Hi st ori cal vol atili t y can be cal cul at ed based on a gi ven ( assumed) mean l ogari thmi c
ret urn or on t he act ual mean logari t hmi c ret urn duri ng t he hi st ori cal cal cul ati on period.

For a gi ven ( assumed) mean logari t hmi c ret urn per compounding period , t he hi st ori cal
vol at il i t y

over cal cul ati on period ( s,e) , compounded t o t he speci fi ed compoundi ng
peri od of PeriodLengt h bars i s gi ven by:

1
1
0
2

|
|
.
|

\
|

=

=

n
t h Per iodLeng
r
t h Per iodleng
n
i
i e




where n = e- s+ 1 and r
t
= ln(P
t
/ P
t - 1
).

92
Usi ng t he act ual mean l ogari thmi c ret urn duri ng t he hi st ori cal cal cul at ion peri od, t he
hi st ori cal vol atil i t y

over cal cul at i on period ( s,e) , compounded t o t he speci fi ed
compoundi ng period of PeriodLengt h bars i s gi ven by:

1
1
1
0
2
1
0
2

|
|
.
|

\
|

=

=

n
r
n
r
t h Per iodLeng
n
i
n
i
i e i e



where n = e- s+ 1 and r
t
= ln(P
t
/ P
t - 1
).

I f an overfl ow error occurred during t he comput at i on, a zero val ue i s ret urned.
I f t he cal cul at ion peri od cont ains l ess t han 2 bars, t hi s dat a seri es wi ll ret urn no value.
I f t he st art of t he cal cul ati on peri od i s before model evoluti on st art , t hi s dat a seri es wi ll
ret urn no val ue.


I.1.8 Hurst Exponent
The Hurst Exponent i s a st at i st i cal measure of t he predi ct abili t y of a t i me seri es. I t
i ndi cat es whet her a t i me seri es i s t rend rei nforci ng, mean revert i ng or random. The Hurst
exponent can range f rom 0 to 1. Val ues above 0.5 indi cat e a t r end reinforcing ti me
seri es, val ues bel ow 0.5 indi cat e a mean revert ing seri es and 0.5 i ndi cat es a compl et el y
random seri es. The furt her away t he val ue i s from 0. 5, t he l ess random t he t i me seri es
i s.

The Hurst Exponent i s incl uded i n Adapt i ve Model er as a met hod t o check whet her a
securi t ys pri ce hi st ory cont ai ns any predi ct abili ty or i s mostl y random. For i nst ance,
when Forecast Di rect i onal Accuracy i s l ow, t hi s may be caused by t he l ack of
predi ct abili t y i n t he securi t y pri ces. However i t should be not ed t hat t he Hurst exponent
i s an est i mat e and may not al ways gi ve a compl et e pi ct ure of t he predi ct abi lit y of a t i me
seri es.

Adapt i ve Model ers Hurst exponent cal cul at ion follows an approach commonl y used in
quant i t at i ve finance
40
. Because di fferent ways of cal cul at ing Hurst exponent s exi st , i t
may not be saf e t o compare Hurst exponent s t hat wer e cal cul at ed by di fferent syst ems.
However, t he Hurst exponent s of common fi nanci al ti me seri es cal cul at ed by Adapt i ve
Model er generall y correspond wi t h t hose report ed in lit erat ure.

The cal cul at i on peri od can be speci fi ed. I t i s preferred t o use l arge hi st ori cal sampl e
peri ods. For t hi s reason t he mi ni mum number of hi st ori cal bars requi red for t hi s dat a
seri es i s 1000.

I f t he speci fi ed cal cul at i on peri od i s l ess t han 1000 bars, no val ue i s ret urned.
I f t he st art of t he cal cul ati on peri od i s before model evoluti on st art , t hi s dat a seri es wi ll
ret urn no val ue.


40
See for exampl e: [ Bo Qi an, Khal ed Rasheed, Hurst Exponent and Fi nanci al Market Pr edi ct abi l i t y , I ASTED
confer ence on "Fi nanci al Engi neeri ng and Appl i cat i ons"( FEA 2004) , pp. 203 209, 2004] . The Hurst exponent
chart for t he Dow Jones i n t hi s paper can be exact l y r epl i cat ed wi t h Adapt i ve Model er.
93
I.2 Agent-based Model data series

I.2.1 Bars processed
Thi s i s t he t ot al number of quot e bars t hat have been processed by t he model si nce
model evol ution st ar t .

I.2.2 Orderbook
The dat a seri es i n t hi s cat egory gi ve informat ion about t he number of buy or sell orders
i n t he orderbook before or aft er cl eari ng.

Each of these dat a seri es has a par amet er t o speci f y whet her onl y market orders, onl y
l imi t orders or bot h t ypes of orders shoul d be i ncluded i n t he count . By defaul t , bot h
t ypes of orders will be included.

Al so they have a paramet er t o speci fy t hat t he number of orders shoul d be expr essed as
a per cent age of t he popul at i on si ze.

I .2.2 .1 Buy Order s
Thi s i s t he number of buy orders i n t he Virt ual Market s orderbook before cl earing. ( When
t he model i s paused, t hi s i s the number of buy orders t hat wer e in t he orderbook j ust
before t he l ast Vi rt ual Market cl eari ng took pl ace from whi ch t he current forecast was
deri ved) .

I .2.2 .2 Sell Orders
Thi s i s t he number of sell orders i n t he Virt ual Market s orderbook bef ore cl earing. ( When
t he model i s paused, t hi s i s the number of sel l orders t hat wer e i n t he orderbook j ust
before t he l ast Vi rt ual Market cl eari ng took pl ace from whi ch t he current forecast was
deri ved) .

I .2.2 .3 Buy Order s remaining
Thi s i s t he number of buy orders i n t he Virt ual Market s orderbook t hat remain
unexecut ed af t er t he Vi rt ual Market cl eari ng.

I .2.2 .4 Sell Orders remaining
Thi s i s t he number of sell orders i n t he Virt ual Market s orderbook t hat remain
unexecut ed af t er t he Vi rt ual Market cl eari ng.


I.2.3 Price
Thi s cat egory cont ai ns t he following pri ces generat ed by t he agent - based model :

I .2.3 .1 VM Price
Thi s i s t he Vi rtual Market s cl earing pri ce ( see Vi rt ual Market ) . I n t he defaul t
configurati on, t hi s pri ce will be used as t he Forecast . The Vi rt ual Market Pri ce VMP
t
for
t i me t i s cal cul at ed aft er t he securi t ys pri ce P
t - 1
has been recei ved and t he agent s have
eval uat ed t hei r t radi ng rul es and pl aced t hei r orders.

94
Not e t hat t he dat e and t i me of thi s dat a seri es i s ini ti all y set t o t he expect ed dat e and
t i me of (upcoming) bar t ( for whi ch t he forecast i s int ended) . Aft er bar t has act ual l y
been recei ved, t he dat e and t i me of t hi s dat a seri es i s adj ust ed t o t he act ual dat e and
t i me of bar t (i n case t hi s was di fferent t han t he expect ed dat e and t i me) . I n case a
vari abl e quot e int erval i s used, t he expect ed dat e and t i me i s based on t he average
rounded quot e int erval and wil l obviousl y be most l y i rrel evant si nce t he exact dat e and
t i me of t he next bar ar e st il l unknown.

I .2.3 .2 VM Bid and Ask
These are t he ( hi ghest ) bi d and (lowest ) ask price of any remaining orders of agent s t hat
coul d not be execut ed on t he Virt ual Market . Somet i mes ext reme bi d or ask pri ces may
occur. These are usuall y caused by onl y one or a few agent s wi t h exoti c behavi or and do
not necessari l y have a si gnifi cant effect on t he model . Not e t hat gaps in a bi d/ ask chart
i ndi cat e t hat t her e was no bi d/ ask pri ce at t hat t i me, meaning that all orders wer e full y
execut ed.

I .2.3 .3 VM Spread
Thi s i s t he di fference bet ween t he Virt ual Market s Bid and Ask pri ce as a percent age of
t he Vi rt ual Market Pri ce. The spread i s cal cul at ed aft er t he Vi rt ual Market cl eari ng and
t hus onl y t akes t he remai ning orders int o account t hat coul d not be execut ed. I f t here
was no Bi d or Ask pri ce, no val ue i s ret urned.

I .2.3 .4 Best Agent s Price
The Best Agent s Pri ce i s t he pri ce t hat woul d have been t he cl eari ng pri ce i f onl y the
orders of a group of best performing agent s would have been t aken i nt o account . So for
t he purpose of cal cul at ing t he Best Agent s Pri ce, t he pri ce di scovery mechani sm as
descri bed i n Virt ual Market i s appl i ed t o onl y t he buy and sell orders of t he best
performi ng agent s. Act ual market cl eari ng however al ways t akes i nto account t he orders
of all agent s.

The best agent s ar e sel ect ed every bar and t hus f orm a dynami c group. The group si ze
can be speci fi ed by t he user ( see 5.2.5) . The sel ect i on cri t eri on used i s t he Breedi ng
Fi t ness Ret urn. Not e t hat onl y agent s of at l east t he Mi ni mum Breedi ng Age will be
i ncluded in t he sel ect i on process. I f no orders of t he Best Agent s group can be mat ched,
t hen t he Best Agent s Pri ce wil l be t he aver age of t he hi ghest Best Agent s Bi d pri ce and
t he l owest Best Agent s Ask pri ce. I f t here i s no Best Agent s Bid pri ce t hen t he Best
Agent s Pri ce will be t he Best Agent s Ask pri ce. Vi ce ver sa, i f t here i s no Best Agent s Ask
pri ce t hen t he Best Agent s Pri ce wil l be t he Best Agent s Bi d pri ce. I f nei ther exi st s ( i .e.
when t here ar e no Best Agent s li mit orders) t hen t he Best Agent s Pri ce will be set t o t he
Vi rtual Market pri ce.

The Best Agent s Pri ce can be used as t he Forecast as an al t ernat i ve t o t he Vi rt ual Market
Pri ce ( see 5.2.5 Forecast ) . As for t he Vi rt ual Market Pri ce, The Best Agent s Pri ce BAP
t
at
t i me t i s cal cul at ed aft er t he securi t ys pri ce P
t - 1
has been recei ved and t he agent s have
eval uat ed t hei r t radi ng rul es and pl aced t hei r orders. The dat e and t i me i s set i n t he
same way as for t he Virt ual Market Pri ce dat a seri es.


I.2.4 VM Volume
Volume i s t he t ot al number of shares t hat were t raded on t he Virt ual Market at t i me t .
Volume i s doubl e count ed whi ch means t hat i t i s t he number of shares bought by
agent s pl us t he number of shares sol d by agent s. As t hese number s ar e equal and t he
t ot al i s t wi ce t he number of act ual shares changing hands t hi s i s cal l ed doubl e
counti ng .

95
I.2.5 VM Trades
Thi s i s t he number of agent orders t hat were execut ed on t he Virt ual Market at t i me t . As
ever y agent can pl ace no more t han one order at any t i me t , t hi s i s an indi cat i on of t he
number of agent s t hat were act i vel y t radi ng at t ime t ( not counti ng t hose whose orders
coul d not be execut ed). Not e t hat when an agent swi t ches a long posi ti on for a short
posi ti on or vi ce versa, t hi s i s count ed as a si ngl e t rade ( al t hough t he fi xed broker fee wil l
be charged t wi ce) .

Thi s dat a seri es has a par amet er t o speci fy whet her all orders, onl y market orders, or
onl y l i mi t orders should be incl uded in the count . By defaul t , all orders are i ncluded.


I.2.6 Bar Return
These are bar- t o- bar ret urn dat a seri es for t he Virt ual Market Pri ce. They ar e cal cul at ed
i n t he same way as t he Securi t y Bar Ret urn dat a seri es.


I.2.7 VM Return
The VM Ret urn dat a seri es gi ves t he ret urn of t he Vi rt ual Market pri ces over t he speci fi ed
cal cul at ion period usi ng t he speci fi ed cal cul ati on met hod. I t i s cal cul at ed in t he same way
as t he Securi t y Ret urn dat a seri es.


I.2.8 VM Volatility
The VM Vol at ili t y dat a seri es cal cul at e t he wei ght ed or hi st ori cal vol atili t y of t he Vi rt ual
Mar ket pri ces. They are cal cul at ed i n t he same way as t he Securi t y Vol at ili t y dat a seri es.


I.2.9 Forecast
The forecast pri ce F
t
for t he securi t y for ti me t i s ei t her t he Virt ual Market Pri ce ( by
defaul t ) or t he Best Agent s Pri ce, as speci fi ed by t he user ( see 5.2.5 Forecast ).


I.2.10 Forecast Accuracy
I .2.1 0.1 Forecast ed Price Change
The Forecast ed Pri ce Change i s t he difference bet ween a forecast ( F
t
) and t he most
recent securi t y pri ce ( P
t - 1
) t hat was known by t he agent - based model when generat i ng
t he f orecast . Posi ti ve/ negat i ve val ues i ndi cat e higher/ l ower forecast s t han t he most
recent pri ce.

1
1

|
|
.
|

\
|
=
t
t
P
F
e Pr iceChang For ecast ed


The si gn of t he Forecast ed Pri ce Change indi cat es t he forecast ed di rect ion of pri ce
change and t hi s dri ves t he Tradi ng Signal Generat or. I t s absolut e val ue t ell s how close
t he f orecast s ar e t o t he most recent real market pri ce and can be an indi cat or of
vol at i li t y, model st abil it y, forecast confi dence or ot her f act ors and can t hus be i mport ant
for t he Tradi ng Syst em. The influence of t he absolut e val ue on t he Tradi ng Syst em can
t herefore be cont roll ed by t he Significant Forecast Range paramet er i n t he Trading
Syst em par amet ers.
96

When t he forecast i s exact l y equal t o t he most recent pri ce ( or when t he Forecast ed Pri ce
Change i s out si de t he Si gnificant Forecast Range) , t hi s wi ll not be consi dered an act ual
forecast because no ( si gnifi cant ) direct i on of price change i s forecast ed. Thi s i s rel evant
for t he Forecast Di rect i onal Accuracy and Forecast Di rect i onal Si gnifi cance dat a seri es
and al so for t he Trading Syst em whi ch will regar d t hese as neut r al (insi gnifi cant )
forecast s.

Thi s dat a seri es has a Source paramet er t hat allows t he user t o sel ect whi ch pri ce dat a
shoul d be used as t he Forecast f or t he purpose of cal cul ati ng t hi s dat a seri es. Thi s can be
ei t her t he Virt ual Market Pri ce or t he Best Agent s Pri ce (regardl ess of whi ch pri ce dat a
has been sel ect ed as t he basi s for t he Forecast i n t he Model confi gurat i on paramet ers) .
Thi s allows easy compari son of the forecast accuracy of t he Vi rtual Market Pri ce and t he
Best Agent Pri ce. The Source par amet er can al so be set t o Forecast ( t hi s i s t he defaul t
set t i ng) indi cat i ng t hat what ever has been sel ect ed as t he basi s for t he Forecast i n t he
Model confi gurat i on paramet er s shoul d be used for t hi s dat a seri es.

I .2.1 0.2 Forecast Er ror
The Forecast Error gi ves t he di fference bet ween t he forecast ( F
t
) and t he securi t y pri ce
( P
t
) at t i me t for whi ch t he forecast was i nt ended. Posi ti ve/ negat i ve val ues i ndi cat e
hi gher/ l ower forecast s t han t he act ual pri ce.

Forecast Error
t
= F
t
- P
t


The Forecast Error can al so be expr essed as a percent age of pri ce ( by set t i ng t he
correspondi ng paramet er) . The cal cul at ion t hen becomes:

1
|
|
.
|

\
|
=
t
t
t
P
F
ror Forecast Er ( Relat ive)


Al t hough t he Forecast Error i s oft en bi gger t han t he Forecast ed Pri ce Change, t he si gn of
t he Forecast Error (in rel ati on to t he si gn of t he Forecast ed Pri ce Change) i s generall y
more i mport ant t han i t s absol ut e val ue. Thi s i s because t he si gn of t he Forecast ed Pri ce
Change indi cat es t he forecast ed di rect i on of pri ce change and t hi s dri ves t he Tradi ng
Si gnal Generat or.

Thi s dat a seri es has a Source paramet er.

I .2.1 0.3 Mean Absolut e Error
The Mean Absol ut e Error ( MAE) i s t he average of t he absolut e forecast errors during a
gi ven period.

More preci sel y, t he MeanAbsolut eError over cal cul at ion period ( s,e) i s:

=

=
1
0
1
n
i
i e
ror Forecast Er
n
t eError MeanAbsolu


where n = e- s+ 1 and Forecast Error
t
i s defi ned as t he Forecast Error dat a seri es.

The paramet er Express as a percent age of pri ce can be used t o get t he Mean Absolut e
Error as a per cent age of t he securi t y pri ce.

Thi s dat a seri es has a Source paramet er.

97
I f t he st art of t he cal cul ati on peri od i s before model evoluti on st art , t hi s dat a seri es wi ll
ret urn no val ue.


I .2.1 0.4 Mean Squared Error
The Mean Squared Error ( MSE) i s t he aver age of t he squar ed forecast error during a
gi ven period. The MeanSquaredError over cal cul at i on peri od ( s,e) i s:

=

=
1
0
2
1
n
i
i e
ror Forecast Er
n
dError MeanSquare


where n = e- s+ 1

For t he rest , t hi s dat a seri es i s equi val ent t o t he Mean Absolut e Error dat a seri es.

I .2.1 0.5 Root Mean Squared Error
Thi s dat a seri es ret urns t he squar e root of t he Mean Squared Error dat a seri es.

I .2.1 0.6 Right / Wrong Forecast ed Price Changes
The Ri ght Forecast ed Pri ce Changes dat a seri es shows t he securi t ys cl ose pri ce, but onl y
t hose line segment s are shown (i n blue) t hat correspond t o pri ce changes for whi ch t he
ri ght direct ion was forecast ed. Thi s provi des a vi sual indi cat ion of how many pri ce
changes wer e forecast ed correct and al so of t he magni t ude of t hose pri ce changes.

Li kewi se, t he Wrong Forecast ed Pri ce Changes dat a seri es shows t he line segment s ( i n
red) correspondi ng t o pri ces changes for whi ch the di rect i on was forecast ed wrong.

I t i s recommended t o show bot h dat a seri es t oget her i n one chart .

Not e: When a long Chart peri od i s used ( spanning several t housands of bars) , t hese dat a
seri es wil l not be drawn because of i nsuffi ci ent space t o render t he l ine segment s cl earl y.
I n t hi s case t he name of t he dat a seri es above t he chart will be shown in gray.

Thi s dat a seri es has a Source paramet er.

I .2.1 0.7 Forecast Direct ional Accuracy
Thi s a t he percent age of bars duri ng a gi ven period for whi ch t he forecast ed pri ce change
was in t he same di rect i on as t he act ual pri ce change ( from t he l ast pri ce on whi ch t he
forecast was based t o t he new pri ce) .

Cases wher e F
t
= P
t - 1
( neut ral forecast ) or P
t
= P
t - 1
( no pri ce change) are count ed as
nei ther a right nor a wrong forecast and are deemed i nsi gnifi cant forecast s. When t he
Appl y Signi fi cant Forecast Range par amet er i s checked, cases where t he absolut e
forecast ed pri ce change i s out si de t he Si gnifi cant Forecast Range ar e al so deemed
i nsi gnifi cant . A Forecast Di rect ional Accuracy of 50% t heref ore al ways indi cat es exact l y
t he same number of right and wrong forecast s even t hough some (or all) forecast s may
have been i nsi gnifi cant . 50% i s t hus t he neut ral l evel for t hi s i ndi cat or.

When t he Forecast Di rect i onal Accuracy i s frequent l y above 50% t hi s i ndi cat es
forecast i ng success ( t hough i t may not necessaril y be enough t o cover t ransact i on cost s,
l osses, et c.) . Al so see 7.1 Evaluat i ng forecast ing success for more on how t o int erpret
model behavior and f orecast i ng abili ti es.

98
Not e t hat when t here ar e frequent insi gnifi cant forecast s t he indi cat or becomes l ess
si gni fi cant because l ess si gnifi cant forecast s wer e incl uded in the aver age. For t hi s reason
i t i s recommended t o consul t t hi s indi cat or in combinat ion wi t h t he Forecast Di rect i onal
Si gnifi cance dat a seri es.

More preci sel y, t he Forecast Direct i onalAccuracy over a cal cul ati on peri od (s,e) i s gi ven
by:

n
FDA
ccur acy r ect ionalA For ecast Di
n
i
i e

=

=
1
0



where n = e- s+ 1 and:

<> =
= =
<> =
=
0 eDir ect ion Pr iceChang AND r ect ion For ecast Di - eDir ect ion Pr iceChang if 0,
0 eDir ect ion Pr iceChang OR 0 r ect ion For ecast Di if 0.5,
0 eDir ect ion Pr iceChang AND r ect ion For ecast Di eDir ect ion Pr iceChang if 1,
FDA
i i i
i i
i i i
i




where

=
<
>
=

1
1
i i
1 - i i
i i
i
P P if 0,
P P if 1, -
P P if 1,
ir ect ion iceChangeD Pr



and Forecast Di rect ion
i
i s defined as follows:

When Appl y Signifi cant Forecast Range i s checked,

+ > + <
+ < + >
=
ot her wise 0,
RangeMax) ( 1 / P F AND RangeMin) ( 1 / P F if 1, -
RangeMax) ( 1 * P F AND RangeMin) ( 1 * P F if 1,
r ect ion For ecast Di
1 - i i 1 - i i
1 - i i 1 - i i
i




where RangeMin and RangeMax are defi ned by t he Si gnifi cant Forecast Range as
speci fi ed in the Trading Syst em par amet er s.

When Appl y Signifi cant Forecast Range i s not checked,

=
<
>
=
1 - i i
1 - i i
1 - i i
i
P F if 0,
P F if 1, -
P F if 1,
r ect ion For ecast Di



When t he wei ght ed par amet er i s checked, t he FDA
i
val ues are exponent i al l y wei ght ed
t o gi ve more emphasi s on recent bars. Thi s may increase t he forward indi cat i veness of
t he dat a seri es. The formul a for t he wei ght ed FDA over a cal cul at ion period ( s,e) i s:

99

=
1
0
1
1
n
i
i
i e
n
FDA uracy ct ionalAcc recast Dire Weight edFo




where n = e- s+1 and =0.97.

Note that with =0.97 and a confidence level of 99%, the required number of values to
i nclude suffi ci ent i nformat i on int o t he cal cul at ion i s 151 ( al so see wei ght ed vol at il i t y) .
Therefore, n i s aut omat i call y maxi mi zed t o 151 for t he wei ght ed FDA cal cul at ion.

Thi s dat a seri es has a Source paramet er.

I f t he st art of t he cal cul ati on peri od i s before model evoluti on st art , t hi s dat a seri es wi ll
ret urn no val ue.

I .2.1 0.8 Single Bar FDA
Thi s dat a seri es ret urns t he FDA of onl y t he l ast bar. I t s values are t her efore ei t her 100%
( ri ght forecast ) , 0% ( wrong forecast ) or 50% (insi gnifi cant forecast ) . I t can for inst ance
be used for cal cul at ing t he aut ocorrel at ion of FDA by addi ng an aut ocorrel ati on indi cat or
t o t hi s seri es.

For t he rest , t hi s dat a seri es i s equi val ent t o t he FDA dat a seri es.

I .2.1 0.9 Forecast Direct ional Significance
Thi s i s t he percent age of si gni fi cant forecast s duri ng a gi ven peri od. Si gni fi cant forecast s
ar e f orecast s wher e F
t
< > P
t - 1
( forecast di ffers from l ast pri ce) and P
t
< > P
t - 1
( pri ce
di ffers from l ast pri ce) . I n ot her words, a si gnifi cant forecast i s a forecast t hat i s useful in
t he sense t hat a Tradi ng Si gnal can be deri ved from i t ( even t hough t he forecast may
t urn out t o be wrong) whereas an insi gni fi cant forecast i s usel ess as i t ei t her doesnt
i ndi cat e an up or down direct i on or i t was gi ven f or a bar t hat t urned out not t o bring any
pri ce change ( such as a holiday) .

I f t he Appl y Signifi cant Forecast Range par amet er i s checked, t he absolut e forecast ed
pri ce change al so needs t o be wi t hin t he Signifi cant Forecast Range i n order for the
forecast t o be consi dered si gnifi cant .

Thi s i ndi cat or gi ves an i ndi cat ion of the si gnifi cance of t he Forecast Di rect i onal Accuracy
dat a seri es. I t does not i mpl y anyt hi ng about t he vali di t y or reli abi lit y of t he Forecast
Di rect i onal Accuracy ot her t han t hat i t count s t he number of si gni fi cant forecast s. Thi s i s
especi all y useful when t he Forecast Di rect i onal Accuracy i s approachi ng unusuall y high or
l ow val ues. Al so, t hi s indi cat or can be used t o see how many act ual f orecast s ( F
t
< > P
t - 1
)
t he Agent - based Model i s generat i ng for t he purpose of eval uat i ng whet her t he model i s
st il l generat i ng forecast s or rat her t ri es t o st ay neut ral and sti ck t o t he market pri ce
( see al so Forecast ed Pri ce Change) .

The Forecast Di rect ionalSigni ficance over a cal culat i on period ( s,e) i s gi ven by:

n
FDS
e ignificanc r ect ionalS For ecast Di
n
i
i e

=

=
1
0



where n = e- s+ 1 and FDS
i
i s defi ned as foll ows:

When Appl y Signifi cant Forecast Range i s checked,

100

+ > + <
+ < + >
<> <>
=
ot her wise 0,
) RangeMax) ) ( 1 / P F AND RangeMin) ( 1 / P ( F
OR RangeMax) ) ( 1 * P F AND RangeMin) ( 1 * P ( F (
AND P P AND P F if 1,
FDS
1 - i i 1 - i i
1 - i i 1 - i i
1 - i i 1 - i i
i




where RangeMin and RangeMax are defi ned by t he Si gnifi cant Forecast Range as
speci fi ed in the Trading Syst em par amet er s.

When Appl y Signifi cant Forecast Range i s not checked,

<> <>
=
ot herwise 0,
P P AND P F if 1,
FDS
1 - i i 1 - i i
i



Thi s dat a seri es has a Source paramet er.

I f t he st art of t he cal cul ati on peri od i s before model evoluti on st art , t hi s dat a seri es wi ll
ret urn no val ue.


I .2.1 0.10 Forecast Direct ional Area Under Curve ( FD AUC)
Thi s i s t he Area Under t he ROC
41
Curve ( AUC) of t he forecast ed di rect i ons. The AUC i s
an i ndi cat or t hat i s used in machine l earni ng, dat a mini ng and ot her fi elds t o measure
t he di scri mi nati ng abili t y of a cl assi fi er. The AUC compar es t he t rue posi ti ve rat e ( TPR)
ver sus t he f al se posi t i ve rat e ( FPR) .

For cal cul at i ng t he Forecast Di rect i onal AUC i n Adapt i ve Model er, t he forecast i s regarded
as a bi nary cl assi fi er predi ct ing ei t her posi ti ve or negat i ve pri ce changes. The si ngl e
poi nt AUC
42
now refl ect s t he probabil it y t hat when one posi t i ve and one negat i ve pri ce
change are randoml y pi cked from hi st ory, t he cl assi fi er has predi ct ed t he di rect ion of
bot h pri ce changes correct l y. I t t hus refl ect s whet her t he Forecast Di rect ional Accuracy
can be at t ri but ed t o correct cl assi fi cat i on ( predi ct i on) of bot h posi ti ve and negat i ve pri ce
changes or t o heavi l y bi ased dat a ( i .e. more posi ti ve pri ce changes t han negat i ve ones)
and a f orecast t hat si mpl y exploi t s t hi s bi as.

The AUC normall y ranges from 0.5 t o 1. An AUC of 1 means perfect predi ct i on whil e an
AUC of 0.5 means t hat t he cl assi fi er does not perform bet t er t han random guessi ng. An
AUC below 0.5 i s al so possi bl e. I t indi cat es t hat t he cl assi fi er has di scri mi nati ng abil it y,
however i t s predi cti ons are rever sed. By rever sing t he predi ct i ons, t he cl assi fi er may st i ll
be useful .

The Forecast Di rect ionalAUC over a cal cul at i on period ( s, e) i s gi ven by:

Forecast Direct i onalAUC = ( TPR + 1 - FPR) / 2

where TPR i s the number of correct l y forecast ed up bars ( t rue posi ti ves) di vi ded by t he
t ot al number of up bars duri ng t he cal cul at ion peri od and FPR i s t he number of

41
Recei ver Operat i ng Charact eri st i c; a measur e of t he f ract i on of t rue posi t i ves versus t he fract i on of fal se
posi t i ves. See for i nst ance: Fawcet t , T. ( 2003) . Roc gr aphs: Not es and pract i cal consi derat i ons for dat a mi ni ng
r esearchers. Techni cal Report HPL- 2003- 4. HP Laborat ori es.
42
I t shoul d be not ed t hat t he concept of AUC i s most l y associ at ed wi t h cl assi fi ers t hat ret urn cont i nuous val ues
t hat ar e t urned i nt o bi nary cl assi f i ers by usi ng a di scr i mi nat i on t hr eshol d. For such cl assi fi ers, a f ul l ROC curve
can be made t hrough mul t i pl e ( TPR, FPR) poi nt s by varyi ng t he di scri mi nat i on t hreshol d. Her e however , t he
di rect i onal forecast i s used as a bi nary cl assi f i er i n i t sel f wi t hout an adj ust abl e t hr eshol d so onl y one ( TPR, FPR)
poi nt exi st s. The cal cul at i on i s t her efor e a si ngl e poi nt AUC.
101
i ncorrect l y forecast ed up bars ( fal se posi ti ves) di vi ded by t he t ot al number of down bars
during t he cal cul at i on period.

Bars wher e F
t
= P
t - 1
( neut ral forecast ) or P
t
= P
t - 1
( no pri ce change) ar e excl uded from t he
TPR and FPR count . When t he Appl y Si gni fi cant Forecast Range par amet er i s checked,
bars wher e t he absol ut e forecast ed pri ce change i s out si de t he Signifi cant Forecast Range
ar e al so excl uded f rom t he TPR and FPR count .

Thi s dat a seri es has a Source paramet er.

I f t he st art of t he cal cul ati on peri od i s before model evoluti on st art , t hi s dat a seri es wi ll
ret urn no val ue.


I.2.11 Filtered Volatility
The fil t ered vol at il it y dat a seri es provi de a way t o st udy t he hi st ori cal vol atil i t y of the
securi t y duri ng right forecast ed bar s separ at el y from t he vol atili t y during wrong
forecast ed bars. Thi s can be meani ngful informat i on si nce (obviousl y) t he dif ference
bet ween t he vol atili t y during ri ght forecast ed bars and t he vol at ili t y during wrong
forecast ed bars i s one of t he fact ors t hat det ermine t radi ng ret urns. Cl earl y, when t he
vol at i li t y of ri ght forecast ed bars i s higher (on aver age) t han t he vol at il it y of wrong
forecast ed bars, t he t r ading ret urns wi ll be higher t han i n t he opposi t e scenari o ( all el se
bei ng equal ) . Apart from having a hi gh Forecast Direct i onal Accuracy, a model can
i ncrease t he ret urns of i t s t rading si gnal s by focusi ng more on bars wi t h a high expect ed
vol at i li t y t han bars wi t h a l ow expect ed vol at ili t y. Thi s way a model can benefi t from
aut ocorrel at ion of vol atil it y i f present .

The fil t ered vol at il it y concept can al so be used as a par amet er i n t he St at i st i cal
Si mul ations ( Mont e Carlo) dat a seri es t o si mul at e t he effect s of di ff erences i n Ri ght Bar
vs. Wrong Bar vol at i li t y on ret urns.

Preci sel y, t he filt ered vol at ili t y dat a seri es consi st of three di fferent dat a seri es:
- Ri ght bars (vol at i lit y of right forecast ed bars)
- Wrong bars ( vol atili t y of wrong forecast ed bars)
- I nsi gnifi cant bars ( vol at ili t y of bars for whi ch the forecast was i nsi gnifi cant )

The defi ni tions of ri ght , wrong and insi gnifi cant bars correspond exact l y wi t h those of t he
Forecast ed Di rect i onal Accuracy dat a seri es. The fi l t ered vol at i lit y seri es incl ude in t he
vol at i li t y cal cul ati on onl y t hose bar s during t he speci fi ed cal cul at ion peri od t hat ar e of t he
sel ect ed t ype ( ri ght , wrong or insi gni fi cant ) . I f t he number of bars t hat can be i ncl uded in
a cal cul at i on i s l ess t han 2, a zero val ue i s ret urned.

The fil t ered vol at il it y seri es ar e ot herwi se i mpl ement ed in t he same way as t he Securi t ys
hi st ori cal vol atil i t y dat a seri es.

I.2.12 Population
Thi s cat egory cont ai ns several dat a seri es t hat present i nformat i on about t he agent
popul ation. Not e t hat t her e ar e no popul ation ret urn dat a seri es. Thi s i s because
popul ation ret urn i s di ffi cul t to defi ne because of compli cat i ons caused by agent
repl acement s. However, vari ous dat a seri es are provi ded t o st udy t he agent weal t h and
ret urn di st ri buti ons and indi vidual agent weal t h and ret urns. ( All agent weal t h and ret urn
cal cul at ions t ake i nt o account t he Broker commi ssi ons for agent ) .

102
I .2.1 2.1 Population Size
Thi s i s t he number of agent s i n t he popul ati on. The popul ati on si ze normall y st ays st abl e
during model evol ution.

I .2.1 2.2 Average Agent Age
Thi s i s t he aver age agent age measured i n numbers of bars si nce agent cr eat i on.

I .2.1 2.3 Age Dist ribut ion
Thi s dat a seri es shows a hi st ogram of t he di st ri bution of agent age ( measured in
numbers of bars since agent cr eat i on) . Not e t hat usuall y several agent s have a low age
as a r esul t of breeding.

I .2.1 2.4 Average Agent Wealt h
Thi s i s t he t ot al agent popul ation weal t h di vi ded by t he number of agent s. Preci sel y,
Aver ageAgent Weal t h
t
at t i me t wi t h Popul at i onSize
t
bei ng t he number of agent s in t he
popul ation and Agent Wealt h
i, t
bei ng t he weal t h of agent i at t i me t , i s gi ven by:

t
t
t
Size Populat ion
Wealt h Populat ion
nt Wealt h Aver ageAge =


where

=
=
t
Si ze Popul at i on
i
t , i t
h Agent Wealt Wealt h Populat ion
1



and Agent Wealt h
i, t
= Agent Cash
i,t
+ Agent Shares
i, t
* P
t



Agent Cash
i, t
i s t he amount of cash of agent i at t i me t .
Agent Shares
i,t
i s t he ( posi ti ve or negat i ve) number of shares t hat agent i i s hol di ng (long
or short ) at t i me t .
P
t
i s t he securi t ys pri ce at t i me t .

Be awar e t hat t hi s i ndi cat or i s not usef ul for cal cul at ing ret urns of t he agent popul ati on.
Thi s i s because t he popul at ions weal t h can change as a consequence of agent
repl acement .

I .2.1 2.5 Wealt h Dist r ibut ion
Thi s dat a seri es shows a hi st ogram of t he di st ri bution of indi vidual agent weal t h values.
Not e t hat usuall y t he weal t h of sever al agent s i s st i ll near t hei r initi al weal t h because of
t hei r low age.

I .2.1 2.6 St dev Agent Wealt h
Thi s i s an indi cat or of t he st andard devi at ion of agent weal t h. I n fact , t hi s dat a seri es
expr esses t he act ual st andard devi at ion as a per cent age of t he Average Agent Weal t h.
Thi s i s t o make i t easi er t o see changes in weal th di st ri bution apart from changes in t he
t ot al popul ati ons weal t h.

103
I .2.1 2.7 Population Cash
Thi s i s t he t ot al amount of cash owned by al l agent s. The Populat ionCash
t
at t i me t i s:

=
=
t
Si ze Popul at i on
i
t , i t
Agent Cash Cash Populat ion
1



I .2.1 2.8 Population Position
Thi s i s t he t ot al posi ti on i n t he securi t y of all agent s expr essed as a percent age of t hei r
t ot al weal t h. The Populat ionPosit ion
t
at ti me t i s cal cul at ed by:

t
t
t
Wealt h Populat ion
Cash Populat ion
Posit ion Populat ion = 1


Not e t hat short posi ti ons are expr essed as negat i ve val ues.

Thi s cal cul ati on i s equi val ent wi t h a wei ght ed aver age posi ti on where all t he i ndi vi dual
agent s posi ti on values ar e wei ght ed by t hei r weal t h.

I .2.1 2.9 Posit ion Dist ribut ion
Thi s dat a seri es shows a hi st ogram of t he di st ri bution of indi vidual agent posi ti on values
( see Agent Posi tion) . Not e t hat t he mean of thi s dat a seri es i s not equal to t he val ue
ret urned by t he Popul at i on Posi tion dat a seri es. Thi s i s because t he mean i s cal cul at ed
here as t he average of all agent posi ti on values whil e t he Popul ation Posi ti on dat a seri es
cal cul at es in fact t he aver age agent posi t ion wei ght ed by agent weal t h.

I .2.1 2.10 Breeding fit ness ret urn dist ribut ion
Thi s dat a seri es shows a hi st ogram of t he di st ri bution of t he Breedi ng fi t ness ret urn of
i ndi vi dual agent s.

I .2.1 2.11 Breeding fit ness excess ret urn dist ribut ion
Thi s dat a seri es shows a hi st ogram of t he di st ri bution of t he Breedi ng fi t ness excess
ret urn of i ndi vi dual agent s.

I .2.1 2.12 Replacement fitness ret urn dist ribution
Thi s dat a seri es shows a hi st ogram of t he di st ri bution of t he Repl acement fi t ness ret urn
of indi vi dual agent s.

I .2.1 2.13 Replacement fitness excess ret ur n dist ribut ion
Thi s dat a seri es shows a hi st ogram of t he di st ri bution of t he Repl acement fi t ness excess
ret urn of i ndi vi dual agent s.

I .2.1 2.14 Trade Durat ion Dist ribut ion
Thi s dat a seri es shows a hi st ogram of t he di st ri bution of t he Trade Durat i on of indi vidual
agent s ( t he average number of bars bet ween t rades) .

104
I .2.1 2.15 Volat ilit y Dist ribut ion
Thi s dat a seri es shows a hi st ogram of t he di st ri bution of t he Vol ati li t y of indi vi dual agent s
( see Agent Vol at i lit y) .

I .2.1 2.16 Beta Dist ribut ion
Thi s dat a seri es shows a hi st ogram of t he di st ri bution of t he Bet a of indi vi dual agent s
( see Agent Bet a) .

I .2.1 2.17 Generat ion Dist ribut ion
Thi s dat a seri es shows a hi st ogram of t he di st ri bution of t he generat i on val ues of
i ndi vi dual agent s. An agent s gener at i on i s si mply i t s geneal ogi cal generat ion number i n
t he model s hi st ory. The agent s t hat are creat ed at model ini ti ali zat i on are generat i on 1,
t hei r children are gener at i on 2, et c.

I .2.1 2.18 Offspr ing Dist ribut ion
Thi s dat a seri es shows a hi st ogram of t he di st ri bution of t he number of off spring of
i ndi vi dual agent s ( see Agent Offspri ng) .

I .2.1 2.19 Parent s
Thi s dat a seri es ret urns t he number of agent s i n t he popul at ion t hat ar e par ent s ( have
act ed as par ent i n one or more breedi ng operat i ons t hat resul t ed i n new offspring
agent s) .

I .2.1 2.20 Terminat ions
Thi s i s t he number of agent s t hat were repl aced or ot herwi se t er minat ed.

I .2.1 2.21 Creat ions
Thi s i s t he number of newl y creat ed agent s t hat were added t o t he popul ation.

I .2.1 2.22 Default s
Thi s i s t he number of agent s t hat have def aul t ed ( see Def aul t management ) .

I .2.1 2.23 Margin Calls
Thi s i s t he number of agent s t hat have recei ved a margi n cal l ( see Margi n mai nt enance) .

I .2.1 2.24 Genome Size
The genome si ze i s t he si ze of an agent s t r adi ng rul e measured in the t ot al number of
nodes. A node i s a gene i n the genome such as a funct i on or a val ue. The genome si ze
can be an indi cat or of t he compl exi t y of t he t radi ng rul e. Tradi ng rul es change i n si ze and
st ruct ure because of breedi ng operat ors such as crossover and mut at ion.

The Average Genome Si ze dat a seri es show t he aver age genome si ze of t he enti re agent
popul ation whil e t he Min Genome Si ze and Max Genome Si ze seri es show t he mi ni mum
and maxi mum genome si zes in the agent popul at ion. There i s al so a Genome Si ze
Di st ri bution seri es showi ng t he di st ri buti on of i ndi vi dual agent genome si zes.

105
I .2.1 2.25 Genome Dept h
The genome dept h i s t he hi ghest number of hi erar chi cal l evel s t hat occurs in an agent s
genome ( t r ading rul e). The dept h of a t radi ng rul e can be an indi cat or of i t s compl exi t y.
The Average Genome Dept h dat a seri es show t he average genome dept h of t he ent ire
agent popul ation whil e t he Min Genome Dept h and Max Genome Dept h seri es show t he
mini mum and maxi mum genome dept hs i n t he popul ation. There i s al so a Genome Dept h
Di st ri but ion seri es showi ng t he di st ri bution of i ndi vi dual agent genome dept hs.

I .2.1 2.26 Average Nodes Crossed
Thi s i s t he aver age number of genome nodes ( genes) per agent t hat were exchanged i n
crossover operat i ons.

I .2.1 2.27 Average Nodes Mut ated
Thi s i s the aver age number of genome nodes ( genes) t hat wer e changed per mut at i on
operat i on.

I .2.1 2.28 Mut ations
Thi s i s t he number of mut at i on operat i ons t hat t ook pl ace ( t he number of off spring
agent s t hat were mut at ed) .

I.2.13 Agent
Thi s cat egory cont ai ns dat a seri es t hat gi ve informat ion about i ndi vi dual agent s. When
one of these dat a seri es i s l aunched, an agent number needs t o be provi ded. Not e t hat
t hi s number i s not a unique permanent agent i dent i fi er but si mpl y i ndi cat es a sl ot in
t he agent popul ati on. During t hei r life ti me, agent s occupy one slot in t he agent
popul ation until t hey are repl aced by anot her agent or ot herwi se t ermi nat ed. Aft er t hei r
removal from t he agent popul ati on, t hei r dat a can no l onger be request ed and t he sl ot i s
made avail abl e for anot her agent .

However, si nce agent s are ( usuall y) frequent l y bei ng repl aced by new agent s, i t woul d be
i nconveni ent i f a chart cont ai ning dat a about a speci fi c agent woul d suddenl y di sappear
( when t he agent get s repl aced) whi l e t he user i s wat ching the chart . Therefore, t he
hi st ori cal val ues of agent dat a seri es t hat ar e bei ng shown in a chart ar e bei ng preser ved
even aft er agent t ermi nat ion. The moment t hat a new agent t ook over t he sl ot ( repl aci ng
t he previ ous agent ) i s i ndi cat ed by a dot i n t he chart .

Not e t hat where agent number or agent i i s ment i oned, t he slot number i s meant
unl ess i ndi cat ed ot herwi se.

Most agent dat a seri es are non-recomput abl e. Therefore, when vi ewing an agent dat a
seri es i n a chart , t here may be a gap bet ween t he agent s creat ion bar ( mar ked by a dot
i n t he chart ) and t he st art of t he plot t ed val ues. Once an agent s dat a seri es i s bei ng
shown i n a chart , al l hi stori cal val ues will be saved in t he chart (i ncluding those of
previ ous agent s in t he same slot ) .

I .2.1 3.1 Wealt h
Agent Wealt h
i,t
of agent i at t i me t i s gi ven by:

Agent Wealt h
i,t
= Agent Cash
i,t
+ Agent Shares
i, t
* P
t


Agent Cash
i, t
i s t he amount of cash of agent i at t i me t .
Agent Shares
i,t
t he number of shares of t he securi t y t he agent s holds in i t s port folio (long
or short ) at t i me t .
P
t
i s t he securi t ys pri ce at t i me t .
106

Not e t hat Agent Wealt h of the l ast 250 bars i s st ored for all agent s.

I .2.1 3.2 Posit ion
Thi s i s t he agent s posi t ion in t he securi t y expressed as a percent age of i t s weal t h.
Agent Posit ion
i,t
of agent i at t i me t i s cal cul at ed by:

t , i
t , i
t , i
h Agent Wealt
Agent Cash
ion Agent Posit = 1


I .2.1 3.3 Cumulat ive ret urn
The Cumul ati ve ret urn R
i,t
of agent i at t i me t since i t s creat i on at t i me Creat ionTi me i s
gi ven by:

1 =
me Cr eat i onTi , i
t , i
t , i
h Agent Wealt
h Agent Wealt
R


I .2.1 3.4 Cumulat ive excess ret urn
The Cumul ati ve excess ret urn R
i,t
of agent i at t i me t si nce i t s creat ion at t i me
Creat ionTi me i s gi ven by
43
:

me Cr eat i onTi
t
me Cr eat i onTi , i
t , i
t , i
P
P
h Agent Wealt
h Agent Wealt
R =


where P
t
i s t he securi t ys pri ce at t i me t .

I .2.1 3.5 Breeding fit ness ret urn
The Breeding fi t ness ret urn i s a t rai ling ret urn of a weal t h movi ng aver age. Thi s ret urn
measure i s used as t he fi tness cri t erion for t he sel ect i on of agent s t o breed. More
speci fi call y, i t i s t he ret urn over t he l ast n bar s of an exponenti al movi ng aver age of
agent weal t h, where n i s set t o t he mi ni mum breeding age wi t h a maxi mum of 250. I f
t he agent age i s l ess t han n, no val ue i s ret urned.

I .2.1 3.6 Breeding fit ness excess ret urn
The Breeding fi t ness excess ret urn i s the excess Breeding fit ness ret urn over an
exponent i al moving average of t he securi t ys r et urn during the n- bar period.

I .2.1 3.7 Replacement fit ness ret urn
The Repl acement fi t ness ret urn i s the aver age ret urn of a weal t h movi ng aver age ( si nce
agent cr eat i on) per bar. Thi s ret urn measure i s used as t he fi t ness cri t erion for t he
sel ect i on of agent s t o be repl aced by new agent s. More speci fi call y, i t i s t he cumul at i ve
ret urn ( si nce agent creat ion) of an exponenti al moving aver age of agent weal t h, di vi ded
by agent age ( i n bars) , where n i s set t o t he mini mum breeding age wi th a maxi mum of
250. I f t he agent age i s l ess t han n, no val ue i s ret urned.


43
See 8.5. Memor y l i mi t ati ons.
107
I .2.1 3.8 Replacement fit ness excess ret urn
The Repl acement fi t ness excess ret urn i s the excess Repl acement fi t ness ret urn over an
exponent i al moving average of t he securi t ys r et urn si nce agent creat ion
44
.

I .2.1 3.9 Trade Durat ion
Thi s dat a seri es gi ves an i ndi cat ion of the aver age number of bars bet ween successi ve
t rades of an agent . Thi s can be consi dered as a measure of t he t rading hori zon of an
agent or i t s t rading frequency and i s t herefore an i mport ant el ement of t he
t radi ng/ i nvest ment st yl e of an agent . Preci sel y, t he Trade Durat i on i s t he agent s age ( i n
bars) di vi ded by t he number of t rades (buy or sell t ransact ions) t hat have been execut ed
during i t s lifet i me. Not e t hat when an agent swi tches a l ong posi tion for a short posi ti on
or vi ce ver sa, t hi s i s count ed as a si ngl e t rade ( al t hough t he fi xed broker commi ssi on will
be charged t wi ce) . I f an agent has not made any t r ades yet , no val ue i s ret urned.


I .2.1 3.10 Volat ilit y
Thi s dat a seri es gi ves t he hi st ori cal vol at il it y of an agent s weal t h. As t he vol ati li t y can be
used as a measure of absol ut e ri sk, i t i s an i mport ant el ement of t he t rading/ invest ment
st yl e of an agent . The vol atili t y i s annuali zed and i s cal cul at ed over t he l ast 250 bars (or
l ess if t he agent s age i s l ess t han 250 bars) . The vol at i lit y i s cal cul at ed assumi ng a zero
mean l og ret urn. At l east 20 bars must be avail abl e t o cal cul at e t he agent vol atil i t y so
t he agent s age must be at l east 20 bars or no val ue wi ll be ret urned. For t he rest , t he
vol at i li t y i s cal cul at ed i n the same way as t he securi t ys hi st ori cal vol atil i t y.


I .2.1 3.11 Beta
Thi s dat a seri es gi ves t he bet a of an agent s weal t h ret urns agai nst t he securi t ys r et urns.
Since t he bet a can be used as a measure of rel at i ve ri sk, i t i s an i mport ant el ement of
t he t radi ng/ i nvest ment st yl e of an agent . I n par t i cul ar, i t reveal s whet her an agent i s
usi ng a buy- and- hold st yl e st rat egy (bet a near 1) , a cont rari an st yl e st rat egy ( negat i ve
bet a) or an absolut e ret urn ( hedge fund ) st yl e st rat egy (bet a near 0) . The agent bet a i s
cal cul at ed on t he pri ce changes per bar over t he l ast 250 bars ( or l ess i f t he agent s age
i s l ess t han 250 bars) . At l east 20 bars must be avail abl e t o cal cul at e t he agent bet a so
t he agent s age must be at l east 20 bars or no val ue wi ll be ret urned. For t he rest , t he
agent bet a i s cal cul at ed in t he same way as t he Trading Si mul at or bet a.

I .2.1 3.12 Offspr ing
Thi s dat a seri es ret urns t he number of offspri ng of an agent ( new agent s t hat wer e
creat ed in breedi ng ( crossover) operat i ons in whi ch t he agent was a parent ) . Thi s
number incl udes offspri ng agent s t hat have al ready been repl aced/ t ermi nat ed.



44
See 8.5. Memor y l i mi t ati ons.
108
I.3 Trading System data series

I.3.1 Signal
When added t o a chart , t hi s dat a seri es plot s t he t r ading si gnal s in t he chart usi ng t he
foll owing symbol s:


Long signal

Cash signal

Short signal

Li ke t he f orecast s, t he t radi ng si gnal symbol s are plot t ed at t he next bar ( t he bar
foll owing the l ast bar upon whi ch the forecast and t he si gnal were based) . The dat e/ t i me
of thi s dat a seri es i s t he dat e/ t i me of the close of t he l ast bar upon whi ch t he si gnal was
based ( unli ke t he forecast dat e/ t i me) .

The Y- axi s val ue at whi ch t he symbol s are plot t ed i s t he cl osi ng pri ce of t he securi t y at
t he bar upon whi ch t he forecast and t he si gnal wer e based. I t i s recommended t o show
t he Si gnal dat a seri es in a chart t oget her wi th t he Pri ce dat a seri es and/ or t he Forecast
dat a seri es.

Not e: When a long Chart peri od i s used ( spanning several t housands of bars) , t he si gnal s
wi ll not be drawn because of i nsuffi ci ent space t o render t hem cl earl y. I n t hi s case t he
name of t he dat a seri es above t he chart wil l be shown in gray.

Be awar e t hat t he t r ading si gnal s are not exact ly buy or sell si gnal s but i ndi cat e when t o
ent er ( and exi t ) a long or short posi tion. I .e. a cash si gnal aft er a long si gnal means
sel l and a cash si gnal aft er a short si gnal means buy t o cover.

When added t o t he Current Values window, t he Si gnal dat a seri es show t he l ast
gener at ed si gnal .

I.3.2 Trading Simulator

I .3.2 .1 TS Wealt h
The Weal t h
t
of the Trading Si mul at or at t i me t wi t h Cash
t
bei ng t he amount of cash of t he
Trading Si mul at or at t i me t and Shares
t
t he number of shares hel d long ( posi ti ve val ues)
or short (negat i ve values) by t he Tradi ng Si mulat or at t i me t i s gi ven by:

Wealt h
t
= Cash
t
+ Shares
t
* P
t


I .3.2 .2 TS Posit ion
The Posi t ion
t
in t he securi t y of the Trading Si mulat or at t i me t wi th Cash
t
and Wealt h
t
i s:

t
t
t
Wealt h
Cash
Posit ion = 1


Not e t hat short posi ti ons are expr essed as negat i ve val ues.

Because t he Tradi ng Si mul at or al ways uses al l i ts avail abl e capi t al t o ent er a long or
short posi tion, Posit i on i s usuall y ei t her ( approximat el y) + 100% or - 100% or 0%.
Posit i on can be sli ghtl y diff erent from - 100% or + 100% because of t ransact i on cost s and
109
t he f act t hat t he Posit ion i s cal cul at ed based on t he most recent market pri ce whil e t he
pri ce for whi ch t he posi tion was opened may have been di fferent due t o spreads. I f a
short posi tion i s hel d for some t i me whil e the securi t y pri ce increases, t he Posi ti on will
become l ess t han - 100%.

The dat e and t i me t hat i s shown wi t h t he Posi tion dat a seri es i s equal t o t he ( closing)
t i me of t he l ast i mport ed quot e bar. Of course i t i s not possi bl e t o open a posi tion exact l y
at t he same t i me as t he quot e t hat was used t o gener at e t he t radi ng si gnal . I n reali t y a
posi ti on can onl y be opened some t i me aft er t he quot e t i me, t aki ng i nto account t he ti me
t o recei ve t he quot e, t o cal cul at e t he forecast and t radi ng si gnal and to pl ace and fill the
order. Therefore, t he dat e and t i me for t he posi t i on in fact approxi mat el y indi cat es t he
moment when t he posi t i on was opened.

I .3.2 .3 TS Trades
Thi s i s t he number of t rades of t he Trading Si mul at or t hat were execut ed at t i me t . Thi s
i ndi cat or can onl y have t he foll owing val ues:
- 0 (no t rades)
- 1 ( a singl e buy or sel l t ransact i on to go from no posi ti on t o a long or short
posi ti on or vi ce versa)
- 2 ( t wo buy or sell t ransact i ons t o go from a short posi ti on t o a long posi t ion or
vi ce versa)

When short posi tions are di sabl ed onl y t he val ues 0 and 1 are possi bl e.

I t i s recommended t o add a movi ng average t o t hi s dat a seri es t o show the aver age
number of t ransact i ons per bar.

I .3.2 .4 TS Ret urn
The TS Ret urn dat a seri es measures t he Trading Si mul at ors Weal t h ret urn and i s
ot herwi se compar abl e t o t he Securi t y ret urn dat a seri es. Therefore, combi ning t he TS
Ret urn and t he Securi t y Ret urn dat a seri es i n one chart (bot h usi ng t he same cal cul at i on
peri ods and met hods) provi des a good way of compari ng the Trading Si mul at or ret urn
wi th t he Securi t y ret urn.

Al so a TS Excess Return dat a seri es i s avail abl e for di rect l y cal cul at i ng t he excess
ret urns ( Trading Si mul at or ret urn minus Securi ty ret urn) .

Not e t hat al l Tradi ng Si mul at or ret urn cal cul at i ons t ake int o account al l t ransact i on cost s
(i . e. t he broker commi ssi ons, spread and sl ippage as speci fi ed in t he Tradi ng Syst em
Paramet ers) .

I f t he Trading Si mul at or has not st art ed yet or i f t he cal cul ati on period st art s before
Trading Si mul at or st ar t , no val ue i s ret urned.

I .3.2 .5 Volat ilit y
The vol at ili t y dat a seri es measure t he vol atili t y of the Trading Si mul at ors Weal t h in t he
same way as t he Securi t y vol at il i t y seri es measure t he securi t ys pri ce vol atili t y.

I f t he Trading Si mul at or has not st art ed yet or i f t he cal cul ati on period st art s before
Trading Si mul at or st ar t , no val ue i s ret urned.

I .3.2 .6 Bet a
The bet a dat a seri es measures t he bet a of t he Tradi ng Si mul at or weal t h ret urns agai nst
t he securi t ys ret urns. Besi des t he cal cul at ion period, t he pri ce change int erval can be
speci fi ed ( t o cal cul at e i .e. t he dai l y, weekl y, or mont hl y bet a) .

110
The Bet a over a cal cul ati on period ( s,e) wi t h Wealt hRet urn bei ng a seri es of n weal t h
ret urns over periods of t he speci fi ed pri ce change int erval duri ng ( s,e) and R a seri es of
securi t y ret urns over t hese same periods, i s gi ven by:

2
R
) R , t ur n Re Wealt h ( iance var Co
Bet a

=


where

=
=
1
0
1
n
i
R i t ur n Re Weal t h i
) R ( ) t urn Re Wealt h (
n
) R , t urn Re Wealt h ( iance var Co


Not e t hat when t he pri ce change i nt erval i s bi gger t han t he model s quot e i nt erval (i.e.
weekl y when usi ng dail y quot es) , t he bet a i s only cal cul at ed once per i nt erval (i .e. once
per week) . For t hi s reason t he chart shows t he bet a values by dot s i nst ead of lines.

The bet a dat a seri es al so cal cul at es t he R- squar ed ( squar e of t he bet a) as an indi cat ion
of the proportion of the weal t h ret urns vari ance t hat can be at t ri but ed t o t he securi t y
ret urns vari ance. The R- squared val ue i s shown i n t he dat a overl ay of t he bet a dat a
seri es.

I f l ess t han 20 pri ce change i nt erval s ar e avai l abl e i n t he cal cul at i on peri od, t hi s dat a
seri es ret urns no val ue.
I f t he Trading Si mul at or has not st art ed yet or i f t he cal cul ati on period st art s before
Trading Si mul at or st ar t , no val ue i s ret urned.


I .3.2 .7 Alpha
The al pha dat a seri es measures t he al pha of t he Trading Si mul at or. Al pha i s a measure of
ri sk- adj ust ed excess ret urn.

The Alpha over a cal cul at ion period ( s,e) wi t h Wealt hRet urn being the ret urn of t he
Trading Si mul at or over ( s, e) , compounded t o t he speci fi ed compounding peri od and R
bei ng t he securi t ys ret urn over ( s, e) , compounded t o t he speci fi ed compounding period
and r
f
being t he ri sk free rat e ( per compounding period) i s gi ven by:

Alpha = Wealt hRet urn r
f
Bet a (R- r
f
)

where Bet a i s t he bet a of t he Tradi ng Si mul at or weal t h ret urns agai nst t he securi t ys
ret urns over t he cal cul at i on period (usi ng t he model s quot e int erval as t he bet a s pri ce
change i nt erval ) .

I f Bet a
t
ret urns no val ue, t hen t hi s dat a seri es wi ll ret urn no val ue.
I f t he Trading Si mul at or has not st art ed yet or i f t he cal cul ati on period st art s before
Trading Si mul at or st ar t , no val ue i s ret urned.


I .3.2 .8 Value at Risk ( VaR)
The VaR dat a seri es measures t he Val ue at Ri sk of the Tradi ng Si mul at or weal t h. VaR
gi ves an est i mat e of t he mini mum l oss t hat can be expect ed wi t h a cer t ai n probabili t y
over a gi ven t i me hori zon.

The met hod used t o est i mat e VaR i s hi st ori cal si mul at i on. Hi st ori cal ret urns are sampl ed
from t he speci fi ed cal cul at i on period. The ti me hori zon period l engt h (in bars) for whi ch
t o cal cul at e VaR can al so be speci fi ed. Typi cal l y VaR i s cal cul at ed f or a ti me hori zon of
111
one quot e int erval (one bar) for short t erm purposes ( i .e. 1 day i f t he model s quot e
i nt erval i s day) . For long t erm purposes a l onger ti me hori zon period l engt h may be
speci fi ed provi ded t hat enough hi stori cal dat a i s avail abl e.

More speci fi call y, VaR i s t he k
t h
worst ret urn of the Trading Si mul at or ret urns t hat were
cal cul at ed over all t he ( overl apping) sampl e periods of PeriodLengt h bars during t he
cal cul at ion period, where k i s n* , n i s the number of sampl e periods, i s t he speci fi ed
confidence l evel and PeriodLengt h i s t he ti me hori zon peri od l engt h (i n bars) . ( I n fact ,
VaR i s negat ed t o show t he loss as a posi ti ve val ue) .

VaR may be expressed ei t her as an absol ut e amount or as a percent age of t he current
Trading Si mul at or weal t h.

Not e t hat VaR may become negat i ve. Thi s i ndi cat es t hat t he k
t h
worst ret urn i s st ill
posi ti ve.

For a reli abl e VaR cal cul at i on, t he cal cul at ion period should be long enough to cont ai n a
suf fi ci ent number of sampl e peri ods.

I f t he cal cul at ion peri od cont ains l ess t han PeriodLengt h bars, no val ue i s ret urned.
I f t he Trading Si mul at or has not st art ed yet or i f t he cal cul ati on period st art s before
Trading Si mul at or st ar t , no val ue i s ret urned.

I .3.2 .9 Relat ive VaR
The Rel at i ve VaR measures t he Val ue at Ri sk by est i mat i ng t he mi ni mum excess loss
t hat can be expect ed. I nst ead of t he Trading Simul at or sampl e ret urns, t he excess
ret urns are used whi ch are cal cul at ed as Tradi ng Si mul at or ret urn minus securi t y ret urn.
For t he rest , t hi s dat a seri es i s i denti cal t o t he VaR dat a seri es.


I .3.2 .10 Sharpe Rat io
The Sharpe Rat i o dat a seri es measures t he Shar pe rat io of the Trading Si mul at or weal t h.
The Sharpe Rat i o i s a ri sk- adj ust ed performance measure. The SharpeRat io over a
cal cul at ion period ( s,e) wi t h Wealt hRet urn bei ng t he ret urn of the Trading Si mul at or over
( s, e), compounded t o the speci fi ed compoundi ng period and r
f
being t he ri sk free rat e
( per compounding peri od) i s gi ven by:

f
r t ur n Re Wealt h
o Shar peRat i

=


where i s t he hi st ori cal vol at i li t y of the Trading Si mul at or weal t h during ( s,e) ,
compounded t o t he speci fi ed compounding peri od and usi ng act ual mean l og ret urn.

I f

= 0 (i .e. when t he Trading Si mul at or weal t h has not changed during t he cal cul at ion
peri od) t he dat a seri es will ret urn no val ue.
I f t he number of compounding periods in t he calcul at i on period i s l ess t han 0.75, t hi s
dat a seri es will ret urn no val ue.
I f t he Trading Si mul at or has not st art ed yet or i f t he cal cul ati on period st art s before
Trading Si mul at or st ar t , no val ue i s ret urned.

I .3.2 .11 Sortino Ratio
The Sortino Rat io dat a seri es measures t he Sortino rat io of t he Trading Si mul at or weal t h.
The Sortino Rat io i s a modifi cat i on of t he Sharpe Rat i o t hat onl y includes downsi de
vol at i li t y in t he cal cul at ion. The SortinoRat io over a cal cul at i on period ( s, e) wi t h
Wealt hRet urn bei ng t he ret urn of t he Trading Simul at or over ( s, e) , compounded t o t he
112
speci fi ed compoundi ng period and T

being the mini mum accept abl e ret urn ( per
compoundi ng period) i s gi ven by:

Downside
T t ur n Re Wealt h
io Sor t inoRat


=


where
Downside
i s t he hi st ori cal downsi de vol at ili ty of t he Tradi ng Si mul at or weal t h duri ng
( s, e), whi ch i s compounded t o t he speci fi ed compoundi ng peri od and cal cul at ed usi ng
l n(T+ 1) as t he mean l og ret urn per period. ( Only bars wi t h a Trading Si mul at or l og
ret urn lower t han l n( T+ 1) / PeriodLengt h are i ncluded i n t he summat i on of squared excess
ret urns, wi th Periodl engt h being t he number of bars per compounding period) .

I f
Downside
= 0, t hi s dat a seri es wil l ret urn no value.
I f t he number of compounding periods in t he calcul at i on period i s l ess t han 0.75, t hi s
dat a seri es will ret urn no val ue.
I f t he Trading Si mul at or has not st art ed yet or i f t he cal cul ati on period st art s before
Trading Si mul at or st ar t , no val ue i s ret urned.

I .3.2 .12 Risk- adj ust ed Ret urn
The ri sk- adj ust ed ret urn measures t he Tradi ng Si mul at ors ret urn adj ust ed for t he
( hypot het i cal ) cost of keepi ng asi de ext ra buffer capi t al (in ri sk free asset s) t o reserve
agai nst t he ri sky invest ment ( t he Tradi ng Si mulat ors weal t h) . The si ze of t he ext ra
buffer equal s t he VaR of t he Tradi ng Si mul at or and can t herefore i ncorporat e vari ous
degrees of ri sk aversi on by adj ust i ng t he VaR confidence l evel paramet er.

More speci fi call y, t he Ri skAdj ust edRet urn

over a cal cul at i on period ( s,e) wi t h
Wealt hRet urn bei ng t he ret urn of t he Trading Simul at or over ( s, e) , compounded t o t he
speci fi ed compoundi ng period and r
f
bei ng t he risk free r at e (per compoundi ng peri od) i s
gi ven by:

VaR
VaR r t ur n Re Wealt h
t ur n Re ed RiskAdj ust
f
+
+
=
1



where VaR

i s cal cul at ed ( as a per cent age of weal t h) by t he VaR dat a seri es over ( s, e) ,
usi ng t he speci fi ed VaR confidence l evel and using t he speci fi ed compoundi ng peri od as
t he VaR t i me hori zon period l ength.

Because t he VaR cal cul at ion uses t he speci fi ed compounding period as t he t i me hori zon,
t he cal cul at ion period shoul d be l ong enough to cont ai n a suffi ci ent number of sampl e
peri ods for a reli abl e VaR cal cul at ion.

I f VaR ret urns no val ue (i.e. if t he cal cul at i on peri od i s short er t han t he compounding
peri od) , t hen thi s dat a seri es will ret urn no val ue.
I f t he Trading Si mul at or has not st art ed yet or i f t he cal cul ati on period st art s before
Trading Si mul at or st ar t , no val ue i s ret urned.

I .3.2 .13 Maximum Drawdown
Thi s dat a seri es cal cul at es t he maxi mum drawdown of t he Trading Simul at or weal t h t hat
occurred duri ng the speci fi ed cal cul ati on period. Not e t hat t he maxi mum drawdown i s
expr essed as an absol ut e ret urn val ue.

I f t he Trading Si mul at or has not st art ed yet or i f t he cal cul ati on period st art s before
Trading Si mul at or st ar t , no val ue i s ret urned.

113
I .3.2 .14 MAR Ratio
The MAR Rat io refers t o t he Managed Account Report s rat i o whi ch i s defined as
Compounded Annual Growt h Rat e di vi ded by Maxi mum Drawdown. The MAR Rat io dat a
seri es used here gi ves t he MAR rat io of the Trading Si mul at or over a cal cul at ion peri od
( s, e) by:

n MaxDr awDow
t ur n Re Wealt h
MAR =


where Weal t hRet urn i s t he annuali zed Tradi ng Si mul at or ret urn over ( s, e) and
MaxDrawDown i s cal cul at ed over ( s, e) usi ng t he MaxDrawdown dat a seri es.

Not e t hat MAR rat ios cal cul at ed over l onger periods are generall y lower t han over short er
peri ods. Thi s i s because maxi mum drawdown t ends t o increase wi t h longer cal cul at i on
peri ods whil e annuali zed ret urn does not .

I f MaxDrawdown = 0, t hi s dat a seri es will ret urn no val ue.
I f t he Trading Si mul at or has not st art ed yet or i f t he cal cul ati on period st art s before
Trading Si mul at or st ar t , no val ue i s ret urned.

I.3.3 Statistical Simulations

I .3.3 .1 I nt roduct ion
The St at i st i cal Si mul at ions est i mat e t he l i kel y range of t rading ret urns by performi ng a
number of evaluat i ons each consi st ing of a seri es of si mul at ed securi t y ret urns, t rades
and resul ting weal t h values.

The St at i st i cal Si mul at ions i nclude Hi st ori cal Si mul at i on (HS) and Mont e Carlo Si mul ation
( MCS) and are i mpl ement ed as di st ri bution dat a seri es. Thi s means t hat for ever y bar an
ent i re new si mul at ion i s performed, refl ect ing t he present si t uat ion by incorporat i ng
current i nformat i on such as t he sampl e period ( for HS) , Trading Syst em paramet er
val ues, Tradi ng Si mul at or weal t h, et c
45
. When shown in a chart , t he resul t s of t he
si mul ati on are present ed as a hi st ogram of t he ret urns of all t he indi vi dual evaluat i ons of
one si ngl e si mul at ion. The dat a overl ay present s general di st ri but ion st at i st i cs ( mean,
medi an, st andard devi at i on, min, max) as well as t he Val ue at Ri sk, cal cul at ed accordi ng
t o t he speci fi ed paramet er s.

The si mul ations are comput ed as fol lows: a securi t y pri ce change ( r et urn) i s si mul at ed
( by hi st ori cal sampl ing for HS or randoml y generat ed for MCS) and t hen a t rade (t hat
would occur prior t o t hat pri ce change) i s si mul at ed based on t he speci fi ed expect ed
Forecast Di rect i onal Accuracy ( FDA) and Forecast Di rect i onal Signi fi cance ( FDS)
probabili t i es ( and t aki ng int o account t he current posi ti on and the rel evant Tradi ng
Syst em par amet ers) . Thus t he probabi lit y t hat t he si mul at ed posi tion i s i n t he same
di rect i on as t he si mul at ed pri ce change depends on t he expect ed FDA and FDS
probabili t i es. Then t he si mul ations weal t h i s adj ust ed t aki ng int o account t he pri ce
change, broker commi ssi ons, spread, sli ppage, et c. Then t he next pri ce change, t rade
and weal t h adj ust ment ar e si mul at ed and so on until the end of t he i nvest ment hori zon i s
reached. Fi nal l y t he weal t h ret urn i s cal cul at ed ( as Weal t h / St art ingCapi t al - 1) and
compounded t o t he speci fi ed compounding peri od. Thi s entire process forms a si ngl e
eval uat ion and i s repeat ed as many t i mes as t he speci fi ed number of eval uat ions
( st art i ng every eval uat ion wi t h t he same speci fied st art i ng capi t al ).


45
Onl y when usi ng MCS wi t h a fi xed st art i ng capi t al and whi l e l eavi ng al l Tr adi ng Syst em paramet ers
unchanged, t he di ff erent out comes per si mul at i on are onl y bei ng caused by r andom fact ors.
114
I n addi t ion t o t he dat a seri es paramet ers, t he fol lowing Tradi ng Syst em paramet er s can
have an effect on t he St at i st i cal Si mul ation dat a seri es (depending on ci rcumst ances) :
- Allow Short Posit ions
- Gener at e cash signal when forecast is out si de range
46

- St art Capi t al
- all paramet ers i n t he Broker Commission, spread and slippage sect i on

I n case an overflow error occurred during the comput at i on, no value i s ret urned.

Furt her det ail s speci fi c to t he dat a seri es ar e expl ained bel ow.

I .3.3 .2 Hist orical Simulat ion
The Hi st ori cal Si mul at ion dat a seri es has t he foll owing paramet er s:

Par amet er Explanat i on
Cal cul ati on peri od The peri od t o use for hi st or i cal sampl i ng. Securi t y r et urns ar e
randoml y drawn from t hi s peri od. I f t he st art of t he cal cul at ion
peri od i s bef or e model evol ut i on st art , t hi s dat a seri es wi l l
ret urn no val ue.
Compoundi ng per i od

The peri od t o whi ch t he r esul t i ng weal t h ret urn wi ll be
compounded.
Number of eval uat i ons

The number of eval uat i ons per si mul at i on.
I nvest ment hori zon

The number of securi t y r et urns ( bar s) t hat ar e si mul at ed per
eval uat i on.
Expect ed For ecast Di rect i onal Accuracy Expect ed percent age of ri ght for ecast s of al l si gni fi cant
forecast s.
Expect ed For ecast Di rect i onal Si gni fi cance Expect ed percent age of si gni fi cant forecast s of al l forecast s.
Thi s paramet er defi nes t he pr obabi l i t y t hat a ( si mul at ed)
forecast i s si gni fi cant ( i nsi de an i magi nar y si gni fi cance r ange)
and t hat an ei t her ri ght or wr ong for ecast wi l l be si mul at ed.
Use curr ent Tradi ng Si mul at or Weal t h as st art
capi t al
I ndi cat es whet her or not t he curr ent Tr adi ng Si mul at or Weal t h
shoul d be used as t he St art capi t al for t he si mul at i on ( and t hus
ever y eval uat i on) .
St art capi t al

The i ni t i al capi t al of t he si mul ati on ( and t hus every
eval uat i on) .
VaR conf i dence l evel The confi dence l evel t o be used for t he Val ue at Ri sk
cal cul ati on.
Show VaR percent age val ue I ndi cat es whet her t he Val ue at Ri sk shoul d be expr essed as a
percent age of t he St art capi t al ( def i ned above) or as an
absol ut e amount .

I f t he st art of t he cal cul ati on peri od i s before model evoluti on st art , t hi s dat a seri es wi ll
ret urn no val ue.

I .3.3 .3 Mont e Carlo Simulat ion
The si mul at ed securi t y ret urns are normall y di stri but ed
47
wi t h being t he speci fi ed drift
and t he speci fi ed expect ed vol at i li t y.

I t i s possi bl e t o speci fy t he expect ed vol ati li t y separ at el y for right , wrong and
i nsi gnifi cant f orecast ed bars, consi st ent wi t h t he concept of filt ered vol at ili t y. Be awar e
t hat t he vol at i li t y needs t o be speci fi ed per compoundi ng peri od. Therefore, when
changing t he compounding peri od, t he vol atili t y shoul d al so be adj ust ed.

The Mont e Carl o Si mul ati on dat a seri es has t he fol lowi ng paramet er s:

46
Thi s paramet er now r el at es t o t he si mul at ed i nsi gni fi cant bars t hat occur wi t h pr obabi l i t y 1- FDS i nst ead of
t he Si gni f i cant Forecast Range paramet er whi ch i s not used by t he St at i st i cal Si mul at i on dat a ser i es.
47
Obvi ousl y t hi s i s a grave si mpl i fi cat i on of real i t y.
115

Par amet er Explanat i on
Compoundi ng per i od

See Hi st or i cal Si mul at i on.
Number of eval uat i ons

See Hi st or i cal Si mul at i on.
I nvest ment hori zon

See Hi st or i cal Si mul at i on.
Dri f t

The expect ed ret urn of t he securi t y per compoundi ng peri od.
Not e t hat when changi ng t he compoundi ng per i od t he dri f t
shoul d al so be adj ust ed.
Speci fy f il t ered vol at il i t y

Speci fi es whet her fi l t ered or general vol at i l i t y i s bei ng used.
General vol at il i t y The expect ed vol at i l i t y of t he secur i t y per compoundi ng peri od.
Not e t hat when changi ng t he compoundi ng per i od t he vol at i l i t y
shoul d al so be adj ust ed.
Vol at i li t y ri ght f orecast s

The expect ed vol at i l i t y of t he secur i t y per compoundi ng peri od
duri ng ri ght f or ecast ed bars. Not e t hat when changi ng t he
compoundi ng per i od t he vol at i l i t y shoul d al so be adj ust ed.
Vol at i li t y wrong for ecast s

The expect ed vol at i l i t y of t he secur i t y per compoundi ng peri od
duri ng wr ong for ecast ed bar s. Not e t hat when changi ng t he
compoundi ng per i od t he vol at i l i t y shoul d al so be adj ust ed.
Vol at i li t y i nsi gni fi cant forecast s

The expect ed vol at i l i t y of t he secur i t y per compoundi ng peri od
duri ng i nsi gni fi cant forecast ed bars. Not e t hat when changi ng
t he compoundi ng per i od t he vol at il i t y shoul d al so be adj ust ed.
See Expect ed For ecast Di r ect i onal Si gni fi cance f or t he meani ng
of i nsi gni fi cant forecast s.
Expect ed For ecast Di rect i onal Accuracy

See Hi st or i cal Si mul at i on.
Expect ed For ecast Di rect i onal Si gni fi cance

See Hi st or i cal Si mul at i on.
Use curr ent Tradi ng Si mul at or Weal t h as st art
capi t al
See Hi st or i cal Si mul at i on.
St art capi t al

See Hi st or i cal Si mul at i on.
VaR conf i dence l evel See Hi st or i cal Si mul at i on.

Show VaR percent age val ue See Hi st or i cal Si mul at i on.




116
II. Command line syntax

Adapt i ve Model er may be st art ed using any of the foll owing command l ine synt axes:

Command l ine Explanat ion
"Adapt i ve Model er " [ model [ / Updat e] ]

Opens t he speci fi ed model and
opt i onal l y updat es i t .
"Adapt i ve Model er " / RunBat ch: bat chf i l e

St ar t s t he speci fi ed bat ch.
"Adapt i ve Model er " [ / C[ : n] [ quot efi l e] [ confi gurat i on] [ st yl e]
[ / RunToEnd] [ / RunBar s: b] [ / E: export f i l e] [ / Over wri t e] [ / R: r ]
[ / SaveAt End] [ / Model Pat h: pat h] [ / PauseAt End] [ / Cl oseAt End] ]
Cr eat es t he speci f i ed number of model s
usi ng t he speci fi ed quot e- fi l e( s) ,
conf i gurat i on, st yl e and ot her set t i ngs.


The fol lowing paramet er s are used on the command line:

Par amet er Explanat ion
model

Fil ename of model t o open.
/ Updat e Opens t he speci fi ed model and evol ves i t unt il t he end of t he quot e f i l e. Then saves
t he model and exi t s. ( Appl i cat i on wi ll run mi ni mi zed) .
/ RunBat ch: bat chf i l e St art s t he bat ch i n bat chfi l e.

/ C[ : n] Cr eat e new model ( s) for each speci fi ed quot efi l e. n i s an opt i onal number of runs per
quot efi l e. I f n i s not provi ded, one run wi l l be cr eat ed per quot efi l e.
quot efi l e Opt i onal quot e f il ename, a di rect or y cont ai ni ng quot e f i l es or a sel ect i on of quot e
fi l enames usi ng wi l dcards. I f no quot e fi l e i s speci fi ed, a conf i gur at i on fi l e must be
speci fi ed t hat i ncl udes a quot e fi l e. ( I f a speci fi ed quot e fi l e, di rect or y or wi l dcard
sel ect i on does not speci fy any val i d quot e fi l e, no model wi l l be cr eat ed) .
confi gurat i on Opt i onal conf i gur at i on fi l e wi t h paramet er val ues for cr eat i ng t he new model s. I f no
conf i gurat i on i s speci fi ed t he defaul t confi gur at i on wi ll be appl i ed t o al l new model s. I f
a quot e fi l e was speci fi ed on t he command l i ne, any quot e f il e i ncl uded i n t he
conf i gurat i on wi ll be i gnor ed. The confi gurat i on fil e must have an .acn ext ensi on.
st yl e Opt i onal st yl e f il e t o be appl i ed t o al l newl y creat ed model s. I f no st yl e i s speci fi ed
t he defaul t st yl e wi l l be appl i ed t o al l new model s. The st yl e fi l e must have an .aps
ext ensi on.
/ RunToEnd Opt i onal . Speci fi es t hat model evol ut i on shoul d run unt i l t he end of t he quot e fi l e i s
reached. I f nei t her / RunToEnd or / RunBar s i s speci f i ed, model evol ut i on wi l l run unt i l
t he end of t he quot e fil e.
/ RunBars: b Opt i onal . Speci fi es t hat model evol ut i on shoul d run for b bar s.

/ E: expor t fi l e Opt i onal fi l ename of a shar ed export f i l e t o be used by al l model s f or export i ng t he
fi nal val ues at t he end of t he run of t he dat a seri es sel ect ed i n t he speci f i ed st yl e ( or
def aul t st yl e) . ( I f no dat a ser i es ar e sel ect ed, al l dat a seri es wi l l be export ed) .
/ Overwri t e Opt i onal . Speci fi es t hat t he export f i l e speci fi ed i n t he / E swi t ch shoul d be overwr i t t en.
I f / Overwri t e i s not i ncl uded, t he expor t fi l e wi ll be appended t o.
/ R: r Opt i onal . Speci fi es t hat run numbers t o be appended t o model names wi l l st art
count i ng from r. Useful t o add mor e runs t o an al ready exi st i ng seri es of runs.
/ SaveAt End Opt i onal . Speci fi es t hat model are aut omat i cal l y saved at t he end of t he run i n t he
pat h speci fi ed by t he / Model Pat h swi t ch. The fi l enames ar e aut omat i cal l y set t o t he
quot e f i l e name combi ned wi t h t he run number. I f t hi s fil e al ready exi st s t he user i s
prompt ed t o sel ect a pat h and fil ename.
/ Model Pat h: pat h Opt i onal . Speci fi es t he pat h t o save model s i f t he / SaveAt End swi t ch was speci f i ed.

/ PauseAt End

Opt i onal . Speci fi es t hat model s are aut omat i cal l y paused at t he end of t he run.
/ Cl oseAt End Opt i onal . Speci fi es t hat model s are aut omat i cal l y cl osed at t he end of t he run. ( I f
/ SaveAt End was not speci fi ed, al l model dat a wi l l be l ost at t he end of t he run except
for any export ed dat a) .

Not es:
- Any pat h or fil ename t hat cont ai ns spaces should be encl osed wi t hi n doubl e
quot at i on marks.
- All fil enames must i nclude ext ensi ons.
- For bat ch processi ng i t i s recommended t o al so read 10. Bat ch processing and
aut omat i on.

117

III. Genetic programming in Adaptive Modeler

Before expl aini ng how Adapt i ve Model er use genet i c programmi ng, a bri ef general
i nt roduction t o genet i c programmi ng and st rongly t yped genet i c programmi ng will be
gi ven i n I I I . 1 for those not famil i ar wi t h ( st rongly t yped) genet i c programming. Not e t hat
t hi s i s t he general ( conventi onal ) approach of ( st rongl y t yped) genet i c programmi ng. The
way Adapt i ve Model er uses genet i c programmi ng i s expl ained in I I I .2.

III.1 General introduction to genetic programming
Genet i c programmi ng ( GP) i s an evol utionary comput ing t echni que inspi red by bi ologi cal
evol ution to opt i mi ze a popul at i on of comput er programs t o perform a cert ai n t ask. The
programs (or genomes) represent candi dat e solut ions for a gi ven t ask or probl em and
ar e eval uat ed by a cert ai n f itness funct ion t hat measures how well t he program performs
t he t ask / sol ves t he probl em. Fi t t er programs get sel ect ed over l ess fi t programs t o
part i ci pat e in reproduct ion or recombi nat i on operat i ons t o creat e a new gener at i on of
programs. I n a r ecombi nat ion operat i on such as crossover, randoml y chosen part s ( set s
of genes) of t wo programs are exchanged t o cr eat e t wo new programs. A mut at i on
operat or can al so be appli ed t o randoml y change a smal l part of a program. The process
of creat i ng new generat i ons i s repeat ed unti l one or more programs i n t he popul ati on
have achi eved a sat i sfact ory fi t ness l evel . The first gener at ion of programs i s creat ed
randoml y.

GP uses f unct ional programming t o encode t he genomes. I n funct i onal programmi ng a
program i s wri t t en as an expression as opposed t o i mperat i ve programmi ng where a
program consi st s of st at ement s. ( Li sp i s a common exampl e of a funct i onal programmi ng
l anguage) . A funct ional program consi st s of ( mat hemat i cal ) funct ions and ot her symbol s,
al so call ed funct ions and t erminals. Funct i ons are operat ors such as add() or
aver age( ) t hat t ake argument s. Terminal s are const ant s or vari abl es t hat t ake no
argument s. A f unct ional program has a t r ee st ruct ure i n whi ch t he first ( out er) funct ion
call i s t he root node and i t s argument s are t he chil d nodes. These argument s can be
funct ion call s t hemsel ves wi t h lower l evel chi ld nodes for t hei r argument s and so on. For
exampl e a f uncti onal program add( max( x, 5), 2) in t ree repr esent at i on may l ook l i ke
t hi s:



Thi s program si mpl y t akes t he maxi mum of 5 and what ever x i s and t hen adds 2. I n t hi s
exampl e add and max ar e functi ons and x, 5 and 2 are t er minal s.

A funct i onal program can al so be wri t t en as an s- expr essi on or parent hesi zed li st s. A
funct ion call i s t hen wri t t en as a li st wi t h t he f unct i on name fi rst and t he argument s
foll owing. The exampl e i n s- expression becomes ( add ( max x 5) 2) .

To sol ve a probl em wi t h GP, a set of functi ons and t erminal s must be defi ned t hat i s
appropri at e t o t he probl em t o be sol ved. Thi s i s where speci fi c domain knowl edge comes
i n. Choosing the ri ght functi on and t erminal s as well as defining t he ri ght fi tness funct ion
can have a great i mpact on the performance of GP.

add
root

max

x

5

2
118

The creat i on of programs in GP heavil y uses r andom fact ors. The fi rst gener at i on of
programs i s creat ed randoml y. Al so t he crossover and mut at i on operat ors t hat ar e used
t o creat e l at er generat i ons use random numbers. Thi s i s t o ensure t hat t he search space
( of al l possi bl e programs) get s expl ored t horoughl y. However, t he r andom creat i on of
programs can l ead t o programs t hat make no sense at al l or t hat cant even be properl y
eval uat ed because a funct i on argument doesnt ret urn t he t ype of val ue t he funct ion
needs. To ci rcumvent t hi s probl em st rong t yping i s used. I n St rongl y Typed GP ( STGP) a
set of t ypes i s defined ( fi t ting t he probl em domai n) and every funct i on and t erminal i s
defi ned t o ret urn a speci fi c t ype and every funct ion argument i s defi ned t o be of a
speci fi c t ype. Thi s defi nes what functi ons and t ermi nal s can be used as argument s for
ot her funct i ons. When done properl y, st rong t yping can si gni fi cantl y hel p t he creat i on of
more meani ngful and fi t t er programs.


III.2 Genetic programming in Adaptive Modeler
Adapt i ve Model er uses a speci al adapt i ve form of St rongl y Typed GP. The genomes
( programs) are t he agent s t radi ng rul es. Thei r t ask i s t o t rade t he securi t y on t he Virt ual
Mar ket based on t hei r anal ysi s of hi st ori cal quotes. The fi t ness functi on i s a measurement
of an agent s i nvest ment ret urn over a cer t ai n peri od. However, t her e ar e some
i mport ant di fferences bet ween t he way Adapt i ve Model er uses GP and t he gener al way
descri bed above.

III.2.1 Differences between Adaptive Modeler and conventional GP

- I n Adapt i ve Model er, cal cul ati ng t he fi t ness of agent s does not invol ve any ( re-
) execut ion of t hei r t rading rul es on hi st ori cal bars. Thi s i s because t he agent s
have al ready execut ed t hei r t radi ng rul es on t hose hi st ori cal bars once (on behal f
of their rol e in t he Agent - based model ) and Adapt i ve Model er i s onl y int erest ed i n
t he ret urns t hat t hey have al ready made for real in the Agent - based model , not
i n any hypot het i cal ret urns t hat an agent coul d have made i f i t was sent back i n
t i me agai n.
- I n convent ional GP t he programs ar e eval uat ed by t he same fi t ness funct ion ever y
gener at i on. For the purpose of Adapt i ve Model er, a dynami c fi t ness functi on i s
needed. Ever y t i me t he fi tness of agent s i s evaluat ed, t he ret urn cal cul ati on
peri od shift s forward t o incl ude t he most recent quot e bars. ( I n GP t erms t hi s
coul d be call ed a kind of ret raining met hod) .
- Adapt i ve Model er normall y doesnt use t he concept of generat ions as descri bed
above. I nst ead a st eady- st at e approach i s used in whi ch onl y a small part of t he
popul ation i s repl aced at a t i me ( t ypi call y ever y bar) i nst ead of t he ent ire
popul ation at once. Thi s allows for a graduall y changing popul ation whi ch i s
necessar y t o mai nt ain a cert ai n degree of st abilit y.

III.2.2 Input of the trading rules
The input of t he t radi ng rul es consi st s of t he hi st ori cal pri ce and vol ume dat a of t he
securi t y on t he Real Market and t he Virt ual Market .

III.2.3 Output of the trading rules
The out put of t he t radi ng rul es i s an Advi ce consi st ing of a desi red posi ti on in t he
securi t y (as a per cent age of weal t h) and an order li mit pri ce or market order indi cat i on
for buyi ng or sel ling t he securi t y.

119
III.2.4 Defined types
The fol lowi ng t ypes ar e defi ned ( and descri bed in more det ail below t he t abl e) :

Type Descript ion
Advi ce Combi nat i on of a Posi t i on and a Li mi t ( root t ype) .
Posi t i on Posi t i on i n t he securi t y as % of weal t h
Li mi t Order l i mi t pri ce
Di rect i on Posi t i on di rect i on ( l ong, shor t or cash)
Leverage Absol ut e posi t i on si ze as % of weal t h
Quot e Pri ce ( from Real or Vi rt ual Market dat a)
Vol ume Vol ume ( f rom Real or Vi rt ual Market dat a)
Market Market ( Real Market or Vi rt ual Mar ket )
Change Di fference bet ween t wo val ues ( i n %)
Lag Number of bars
Bool Bool ean ( True or Fal se)

I I I .2 .4.1 Advice
Thi s i s t he root t ype of t he genome t ree, meani ng t hat t he genomes root node ( whi ch
ret urns t he fi nal out put of the t radi ng rul e) must be of thi s t ype. An Advi ce consi st s of
combinat ion of a Posit ion val ue and a Limit val ue. They are combined ( encoded) int o an
Advi ce val ue si mpl y because a t r ee can have only one root node and t hus ret urn onl y one
val ue.

I I I .2 .4.2 Position
Thi s t ype i s used t o denot e t he si ze and di rect i on of an agent s posi ti on (asset all ocat i on)
i n t he securi t y as a percent age of i t s weal t h. For i nst ance, i f an agent s posi ti on i s 100%
t hen i t owns onl y shares and no cash. Not e t hat negat i ve posi ti ons represent short
posi ti ons.

I I I .2 .4.3 Limit
Thi s t ype i s used for li mi t pri ces of agent orders or to i ndi cat e a market order. Arguabl y,
t he t ype Quot e coul d have been used for t hi s, but having a speci fi c t ype for order li mi t
pri ces allows more cont rol over t he way order limi t pri ces are bei ng generat ed.

I I I .2 .4.4 Direct ion
Thi s t ype i s used t o denot e posi ti on direct i ons . For t hi s t ype onl y t hree possi bl e val ues
exi st : l ong, short and cash ( corresponding wi th t he si gn of a Posit ion val ue) . Thi s t ype i s
used in combinat ion wi t h Lever age t o cr eat e Posit ion values.

I I I .2 .4.5 Leverage
Thi s t ype i s used for an agent s absol ut e posi t ion si ze as a per cent age of weal t h (in ot her
words t he Posit ion wi t hout sign/ di rect i on) . For inst ance a l ever age of 50% means an
agent has a posi tion of 50% of i t s weal t h in t he securi t y, ei t her long or short . Thi s t ype i s
used in combinat ion wi t h Direct ion t o creat e Posi t ion values.

I I I .2 .4.6 Quot e
Thi s t ype i s used for securi t y pri ces, ei t her from t he Real or Vi rtual Market . I t i s used for
open, high, l ow, close, bi d or ask pri ces. Furt hermore, i t i s used bot h for pri ces t aken
di rect l y from the hi st ori cal dat a as well as for cal cul at ed averages, maxi mum, mi nimum,
et c.

120
I I I .2 .4.7 Volume
Thi s t ype i s used for volume dat a, ei t her from t he Real or Virt ual Market . I t i s used bot h
for volume dat a t aken di rect l y f rom t he hi st ori cal dat a as well as for cal cul at ed averages,
maxi mum, mini mum, et c.

I I I .2 .4.8 Market
Thi s t ype denot es t he mar ket t ype. Onl y t wo values of t hi s t ype exi st : Real Market and
Virtual Market . Thi s t ype i s used for a market ar gument of several functi ons t hat can
operat e on ei t her Real market or Vi rt ual market dat a.

I I I .2 .4.9 Change
Thi s t ype i s used for rel at i ve changes bet ween t wo Quot e val ues or t wo Volume val ues,
for inst ance a pri ce change such as p
t
/ p
t - 1
- 1.

I I I .2 .4.10 Lag
Thi s t ype i s used t o denot e a number of bars.

I I I .2 .4.11 Boolean
Thi s t ype i s used for t he bool ean val ues True or Fal se.


III.2.5 Function and terminal set
I n Adapt i ve Model er, t he function and t ermi nal s ar e al so call ed genes . The ent i re set of
genes wi t h t hei r ret urn t ype and argument t ypes i s shown in t he t abl e below. The
t er mi nal s ( wi th no argument s) have names st ar t ing wi t h a capi t al and are li st ed on top.
The funct i ons foll ow bel ow t he t ermi nal s. Not e t hat some f uncti ons (i .e. + , > and i f )
ar e def ined more t han once for different argument t ypes. The genes are descri bed i n
more det ail below t he t abl e.

Gene Ret urn t ype Arg1 t ype Arg2 t ype Arg3 t ype Arg4 t ype
CurPos Posi t i on
LevUni t Leverage
Ful l Lev Leverage
Rmar ket Market
Vmar ket Market
Long Di rect i on
Short Di rect i on
Cash Di rect i on
Bar Lag
I nvPos Posi t i on
RndPos Posi t i on
RndLi m Li mi t
Mkt Or der Li mi t
open Quot e Lag Market
hi gh Quot e Lag Market
l ow Quot e Lag Market
cl ose Quot e Lag Market
bi d Quot e Lag Market
ask Quot e Lag Market
average Quot e Lag Market
mi n Quot e Lag Market
max Quot e Lag Market
vol ume Vol ume Lag Market
avgvol Vol ume Lag Market
mi nvol Vol ume Lag Market
maxvol Vol ume Lag Market
> Bool Quot e Quot e
> Bool Vol ume Vol ume
121
> Bool Change Change
change Change Quot e Quot e
change Change Vol ume Vol ume
+ Lag Lag Lag
+ Leverage Leverage Lever age
di r Bool Lag Market
i supbar Bool Lag Market
upbars Bool Lag Lag Market
bsmi n Lag Lag Market
bsmax Lag Lag Market
vol at Change Lag Market
rsi > = 80 Bool Lag Market
rsi < = 20 Bool Lag Market
sk> sd Bool Lag Market
sd< sd Bool Lag Market
ema Quot e Lag Market
mfi > = 80 Bool Lag Market
mfi < = 20 Bool Lag Market
pos Posi t i on Di rect i on Lever age
addpos Posi t i on Di rect i on Lever age
li m Li mi t Quot e Quot e Lag Di rect i on
advi ce Advi ce Posi t i on Li mi t
and Bool Bool Bool
or Bool Bool Bool
not Bool Bool
i f Quot e Bool Quot e Quot e
i f Lag Bool Lag Lag
i f Change Bool Change Change
i f Bool Bool Bool Bool
i f Advi ce Bool Advi ce Advi ce
i f Market Bool Market Market
i f Di rect i on Bool Di rect i on Di r ect i on
i f Li mi t Bool Li mi t Li mi t
i f Leverage Bool Lever age Leverage
i f Posi t i on Bool Posi t i on Posi t i on
i f Vol ume Bool Vol ume Vol ume

I I I .2 .5.1 CurPos
CurPos ret urns t he agent s current posi ti on in t he securi t y as a percent age of i t s weal t h
( 100% i s a full long posi tion, 0% i s a full cash posi ti on and - 100% i s a short posi ti on for
100% of weal t h) .

I I I .2 .5.2 LevUnit
LevUni t i s t he mini mum uni t ( st epsi ze) of l everage ( t he absolut e posi tion si ze as % of
weal t h) . During model evol ut ion i t i s a const ant value t hat i s speci fi ed by t he Mini mum
posi ti on uni t set t i ng on t he Model t ab of t he New Model di alog box. Lever age val ues
can be added ( by a + functi on) t o creat e l arger l ever age val ues.

I I I .2 .5.3 FullLev
Ful lLev i s a const ant value of 100% represent i ng ful l lever age . Thi s gene can be used
i nst ead of t he LevUni t and + genes t o force agent s t o onl y pl ace orders for 100%, -
100%, or 0% posi ti ons. I t can al so be used in combi nati on wi th the LevUni t and +
genes. Using t hi s gene may resul t in short er l ever age subt rees si nce l ess +
operat i ons wi ll be required t o reach desi red l everage val ues. Short er genome t rees may
i ncrease comput at i on performance and ar e bet t er readabl e.

I I I .2 .5.4 Rmarket, Vmarket
I ndi cat es t he Real Market ( t he i mport ed securi t y pri ce and vol ume dat a) or t he Virt ual
Mar ket ( t he pri ce and vol ume dat a of t he Virt ual Market ) .

122
I I I .2 .5.5 Long, Short , Cash
I ndi cat es a long, short or cash posi tion direct i on ( const ant val ue of 1, -1 or 0) . These
t er mi nal s are used i n for i nst ance t he pos funct i on t o creat e a Posi ti on by mul tipl ying a
Leverage val ue wi t h a Di rect i on val ue.

I I I .2 .5.6 Bar
I ndi cat es a si ngl e bar ( const ant value of 1) . Thi s t ermi nal i s used t o creat e Lag val ues
t hat are used t o i ndi cat e a peri od l engt h (in number of bars) for ret ri eving hi st ori cal
market dat a or cal cul at i ng i ndi cat ors such as average. Lag values can be added ( by a +
funct ion) t o creat e l arger Lag values. ( Not e t hat Lag val ues ar e al ways at l east 1).

I I I .2 .5.7 I nvPos
I nvPos ret urns t he opposi t e posi tion of t he agent ' s current posi tion by mul t i pl ying t he
current posi ti on wi t h - 1 (long becomes short and vi ce ver sa) .

I I I .2 .5.8 RndPos
Ret urns a r andom posi tion value rangi ng from -100% t o 100% sampl ed from a uni form
di st ri bution.

I I I .2 .5.9 RndLim
Ret urns a r andom li mi t pri ce t hat i s generat ed as f oll ows. Fi rst t he Vi rt ual or Real Market
i s chosen at random. Then t he l ast cl osi ng pri ce i s t aken from t hi s market . Then t hi s
pri ce i s mul tipli ed wit h a normall y di st ri but ed random value with =1 and =3.5 *
m
where
m
i s t he st andard devi at i on of t he log ret urns of t he l ast 20 bars of t he chosen
market
48
.

I I I .2 .5.10 MktOrder
I ndi cat es t hat an order shoul d be pl aced as a market order.

I I I .2 .5.11 open, high, low, close
These funct ions ret urn pri ce dat a from t he Real or Virt ual Market . As argument s t hey
t ake a Lag val ue for speci fying whi ch hi stori cal bar t o ret ri eve t he dat a from and a Market
val ue for speci fying ei t her t he Real or the Vi rtual Market . For i nst ance, open(l ,m) ret urns
t he open pri ce of bar t -l on market m, where t i s t he current bar. For t he Real Market , i f
open, high or low pri ces ar e not i ncluded i n t he quot e fil e, the close pri ce i s ret urned. For
t he Vi rt ual Market , open, hi gh and low al ways ret urn the close pri ce ( t he cl earing pri ce) .
( Not e t hat si nce a Lag val ue i s al ways at l east one, onl y bars before t he current bar can
be request ed. Thi s i s because at t he t i me t he genomes ar e bei ng eval uat ed, t he current
bar number al ready point s t o t he upcomi ng bar t hat st ill needs t o be i mport ed. Therefore
at t he t i me of genome evaluat i on, t he bar before t he current bar al ways has t he most
recent Real Market pri ce dat a) .

I I I .2 .5.12 bid, ask
Bi d and ask ret urn t he bid and ask pri ce dat a for t he speci fi ed bar and market . For t he
Real Market , t he bi d and ask pri ces from t he quot e fil e are ret urned. I f t he bi d or ask
pri ces are not included in t he quot e fil e or if t hey ar e 0, t hen t he close pri ce i s ret urned.
For t he Vi rtual Market , t he bi d and ask pri ce are ret urned as def ined i n VM Bid and Ask.

48
Thi s met hod i s part l y based on [ M. Rabert o, S. Ci ncot t i , S. M. Focar di , M. Marchesi , "Agent - based si mul at i on of
a f i nanci al market ", Physi ca A 299, 319- 327 ( 2001) ] wi t h t he di ff er ence t hat m= 1 i nst ead of 1.01 so t hat no
spr ead i s added/ subt ract ed for i ncreasi ng t he l i kel i hood of an order bei ng execut ed. The r eason for t hi s i s t hat
i n t hi s i mpl ement at i on, at t he t i me t he RndLi m gene i s eval uat ed, i t i s not known whet her t he agent wi l l pl ace a
buy or sel l order and t hus whet her t he spr ead shoul d be added or subt ract ed.
123

I I I .2 .5.13 average, min, max
These funct ions cal cul at e t he average, mi ni mum or maxi mum of the close pri ces over t he
l ast gi ven number of bars on the gi ven mar ket . For exampl e, aver age( l ,m) i s t he aver age
close pri ce over bar s [ t - l , t -1] on market m, where t i s t he current bar. Not e t hat t he hi gh
and l ow pri ce dat a i s not used i n t he cal cul at ion of min and max.

I I I .2 .5.14 volume
Ret urns vol ume dat a for t he speci fi ed bar and market . For t he Real Market t hi s i s t he
vol ume dat a t hat was i ncluded i n t he quot e fil e. ( I f no vol ume dat a i s incl uded in t he
quot e fi l e whil e t hi s gene i s sel ect ed, t hi s functi on ret urns 0) . For t he Vi rtual Market t he
vol ume dat a i s defi ned in VM Volume.

I I I .2 .5.15 avgvol, minvol, maxvol
These funct ions cal cul at e t he average, mi ni mum or maxi mum vol ume over t he l ast gi ven
number of bars on t he gi ven mar ket . For exampl e, avgvol (l ,m) i s aver age vol ume over
bars [ t - l ,t - 1] on market m, wher e t i s t he current bar.

I I I .2 .5.16 >
The funct i on > i s a great er t han compari son for argument pai rs of t he t ypes Quot e,
Volume or Change. I t ret urns True if t he val ue of t he first argument i s great er t han t he
val ue of the second argument , Fal se ot herwi se. Not e t hat a < f unct ion i s not defi ned
nor necessar y si nce t he argument s can be gi ven in ei t her order. Al so > = and =
operat ors are not defined si nce t hey are l ogi cally equi val ent t o not < resp. not > and
not < .

I I I .2 .5.17 change
The change funct i on i s defined for argument pai rs of t he t ypes Quot e or Vol ume. I t
ret urns t he rel at i ve change of t he fi rst argument val ue from t he second argument val ue.
For i nst ance, change( q1,q2) ret urns q1/ q2 1. I n case t he second argument val ue i s
zero, t hi s functi on ret urns zero.

I I I .2 .5.18 +
The + functi on i s defi ned for argument pai rs of t he t ypes Lag and Lever age. I t si mpl y
adds Lag or Lever age val ues t o creat e l arger val ues from smal l er ones.

I I I .2 .5.19 dir
Thi s funct ion cal cul at es t he pri ce di rect i on over t he l ast speci fi ed number of bars on the
gi ven mar ket and ret urns a bool ean val ue t o i ndi cat e whet her or not t he direct i on i s
upwards. More speci fi cal l y, dir(l ,m) ret urns True i f close( t - 1,m) > cl ose( t - 1-l ,m) , where t
i s t he current bar.

I I I .2 .5.20 isupbar
Ret urns a bool ean val ue t o indi cat e whet her t he speci fi ed bar on t he speci fi ed market i s
an up bar or not . More speci fi call y, i supbar(l ,m) ret urns True i f close( t -l ,m) > close( t - l -
1,m) , where t i s current bar

124
I I I .2 .5.21 upbars
Thi s funct ion checks i f t he number of up bars during t he l ast speci fi ed number of bars
on a gi ven mar ket i s higher t han or equal to a given number. More speci fi cal l y,
upbars( l 1,l 2,m) ret urns True i f t he number of up bars on market m duri ng [ t -l 1,t - 1] > =
l 2, where t i s t he current bar.

I I I .2 .5.22 bsmin, bsmax
These funct ions st and for bars si nce mi numum and bars since maxi mum . They ret urn
t he number of bars si nce t he mi ni mum/ maxi mum cl ose pri ce over a gi ven period. For
exampl e, bsmi n(l , m) ret urns t he number of bars since t he mi ni mum cl ose pri ce over bar s
[ t - l ,t - 1] on market m, wher e t i s t he current bar.

I I I .2 .5.23 volat
Thi s funct ion ret urns t he vol ati li t y ( st andard devi ati on) of t he logari t hmi c ret urns of t he
close pri ces duri ng t he gi ven peri od on t he gi ven market . For gi ven argument s l and m,
vol at ( l ,m) ret urns t he st andard devi at ion of t he most recent n bars on market m where n
= l + 9. Since l i s al ways at l east 1, n i s al ways at l east 10.

I I I .2 .5.24 rsi> = 80, r si< = 20
These funct ions cal cul at e an RSI ( Rel at i ve St rengt h I ndex) val ue of t he pri ce dat a of t he
gi ven period and market and ret urn a bool ean t o indi cat e whet her or not t he val ue i s
hi gher t han or equal t o 80 resp. lower t han or equal t o 20. For gi ven argument s l and m,
t he RSI i s cal cul at ed over t he most recent n bars on market m where n = l + 9. Since l i s
al ways at l east 1, n i s al ways at l east 10.

I I I .2 .5.25 sk> sd, sk< sd
These funct ions cal cul at e a St ochast i c Oscil l at or of the pri ce dat a of t he gi ven period and
market and ret urn a bool ean i ndi cat i ng whet her or not t he fast %K si gnal i s hi gher ( resp.
l ower) t han t he slow %D si gnal . For gi ven argument s l and m, t he Stochast i c Oscill at or i s
cal cul at ed over t he most recent n bars on market m wher e n = l + 9. Since l i s al ways at
l east 1, n i s al ways at l east 10. For exampl e, sk> sd( l ,m) ret urns True i f t he fast %K
si gnal i s higher t han t he slow %D si gnal over bars [ t - l ,t - 1] on market m, and Fal se
ot herwi se.

I I I .2 .5.26 ema
Thi s funct ion ret urns an exponenti al moving average of t he pri ce dat a of t he gi ven peri od
and market . For gi ven argument s l and m, ema( l , m) ret urns an exponent i al movi ng
aver age of t he most recent n bars on market m where n = l + 9. Since l i s al ways at
l east 1, n i s al ways at l east 10.

I I I .2 .5.27 mfi> = 80, mfi< = 20
These funct ions cal cul at e an MFI ( Money Fl ow I ndex) value of the volume dat a of t he
gi ven period and market and ret urn a bool ean t o indi cat e whet her or not t he val ue i s
hi gher t han or equal t o 80 resp. lower t han or equal t o 20. For gi ven argument s l and m,
t he MFI i s cal cul at ed over t he most recent n bars on market m wher e n = l + 9. Since l i s
al ways at l east 1, n i s al ways at l east 10. Not e t hat t he MFI cal cul ati on uses vol ume dat a
and for t he Real Market al so hi gh and low pri ces. I f t he vol ume dat a on t he gi ven market
i s zero during the cal cul ati on period, bot h MFI funct ions will ret urn Fal se. I f hi gh and low
pri ces are not included in t he quot e fil e t hey will be consi dered equal to t he cl ose pri ce.

125
I I I .2 .5.28 pos
Thi s funct ion combines a Di rect i on and a Lever age val ue i nt o a Posi ti on. To do t hi s i t
si mpl y mul tipl i es t he Di rect i on val ue wi t h t he Lever age val ue.

I I I .2 .5.29 addpos
Thi s funct ion combines t he Di rect i on and Lever age argument val ues i nto a Posi tion (li ke
pos ) and adds t he agent ' s current posi ti on. The resul ti ng Posi t ion i s ret urned. Not e t hat
t he ret urned posi tion value can be hi gher or lower t han t he agent s current posi tion.

I I I .2 .5.30 lim
Thi s funct ion i s a si mpl e al gori t hm t o cal cul at e an order l i mi t pri ce. I t t akes as argument s
t wo Quot es, a Lag and a Di rect i on. The al gori thm used by t hi s functi on i s based on t he
assumpt ion t hat t raders det er mi ne t hei r order l imi t pri ce ( t o a cert ai n ext ent ) based on
t he observed mar ket pri ces and t he magni t ude of pri ce changes. The al gorit hm cal cul at es
t he difference bet ween t he t wo gi ven Quot e val ues, processes t hi s dif ference a bi t furt her
wi th t he gi ven Lag and Di rect i on values and adds t hi s t o t he first Quot e val ue. The
agent s way of cal cul at ing it s order l imi t pri ce and t he urgency of i t s order can t hus be
represent ed i n t he choi ce of Quot e val ues and Lag and Di rect i on values. Not e t hat t he
Lag and Di rect i on t ypes ar e used here for t heir ari t hmet i c conveni ence and not because
of their meani ng. More speci fi call y, l im( q1,q2,l ,d) = q1 + l * 0.1 * d * ( q2 - q1). Not e
t hat when t he Di rect i on val ue i s Cash ( 0) , t he funct ion si mpl y ret urns q1.

I I I .2 .5.31 advice
Combi nes a Posi tion and a Li mi t val ue int o an Advi ce. The Advi ce i s ul timat el y ret urned
by t he genome ( ei t her direct l y t hrough t hi s funct ion or t hrough an if funct ion) and t hen
processed furt her by t he program as descri bed i n Order generat i on.

I I I .2 .5.32 and, or, not
These are logi cal operat ors on t hei r Bool argument s.

I I I .2 .5.33 if
The i f functi on i s defi ned for al l t ypes. The fi rst argument i s a Bool val ue. I f t hi s i s True,
t he second argument val ue i s ret urned, otherwi se t he t hi rd argument val ue i s ret urned.


< End of Users Gui de>

Anda mungkin juga menyukai