Altreva Adaptive Modeler

 

 

 

Adaptive Modeler

Version 1.2.6

 

User’s Guide

 

 

Copyright © 2003 - 2010 Jim Witkam. All rights reserved.

 

 

 

Adaptive Modeler User's Guide in PDF

User’s Guide in PDF

 

 

 


Brief Contents:

 

1. Introduction. 11

1.1 Agent-based models and financial markets 11

1.2 How Adaptive Modeler uses agent-based models 11

1.3 Adaptive Modeler’s possibilities 11

1.4 Specifications 13

1.5 System requirements 13

1.6 Installation. 14

1.7 Conventions and terminology. 14

1.8 How to use this User’s Guide? 15

1.9 Getting help. 15

1.10 Examples 15

2. Getting Started Tutorial 16

Lesson 1: Model configuration. 16

Lesson 2: Model initialization. 18

Lesson 3: Model evolution. 19

Lesson 4: Agents 22

Lesson 5: Evaluating forecasting abilities 29

Lesson 6: Trading Simulator 32

Lesson 7: Creating your own models 34

3. How does Adaptive Modeler work? 35

3.1 Agent-based Model 35

3.2 Trading System. 39

4. Market Data. 42

4.1 Data retrieval 42

4.2 Quote file format requirements 44

5. Model configuration. 48

5.1 General parameters 48

5.2 Agent-based Model parameters 50

5.3 Genome parameters 53

5.4 Evolution parameters 56

5.5 Trading System parameters 57

5.6 Saving and restoring model configurations 59

6. User Interface. 60

6.1 Controlling model evolution. 60

6.2 Data series tree view. 60

6.3 Charts 61

6.4 Current Values 65

6.5 Trading Signals 65

6.6 Population Window. 65

6.7 Performance Overview. 67

6.8 Market Depth. 69

6.9 Agent Window. 70

6.10 Logger 70

6.11 Customizing the User Interface. 71

6.12 Styles 72

6.13 Computation performance issues 73

7. Trading. 74

7.1 Evaluating forecasting success 74

7.2 Using the Trading Simulator 74

7.3 Statistical Simulations 75

8. More about data series 76

8.1 Parameters 76

8.2 Moving Averages 78

8.3 Autocorrelation. 78

8.4 Recomputable vs. non-recomputable data series 79

8.5 Memory limitations 79

9. Exporting data. 81

9.1 Export Settings 81

9.2 Other Export issues 82

10. Batch processing and automation. 84

10.1 Creating a batch process 84

10.2 Starting a batch. 86

10.3 Saving and opening batch settings 86

10.4 Starting a batch from the command line. 86

10.5 Updating a model 87

Appendices 88

I. Data series reference. 89

I.1 Security data series 89

I.2 Agent-based Model data series 93

I.3 Trading System data series 108

II. Command line syntax 116

III. Genetic programming in Adaptive Modeler 117

III.1 General introduction to genetic programming. 117

III.2 Genetic programming in Adaptive Modeler 118

  


Full Contents:

 

1. Introduction. 11

1.1 Agent-based models and financial markets 11

1.2 How Adaptive Modeler uses agent-based models 11

1.3 Adaptive Modeler’s possibilities 11

1.4 Specifications 13

1.5 System requirements 13

1.6 Installation. 14

1.7 Conventions and terminology. 14

1.7.1 “Securities” and “shares” 14

1.7.2 Market data. 14

1.7.3 Currency. 14

1.7.4 Dates 14

1.8 How to use this User’s Guide? 15

1.9 Getting help. 15

1.10 Examples 15

2. Getting Started Tutorial 16

Lesson 1: Model configuration. 16

Lesson 2: Model initialization. 18

Lesson 3: Model evolution. 19

Controlling Charts 21

Lesson 4: Agents 22

Viewing agent details 22

Agent charts 24

Trading rules 25

Viewing the population. 26

Breeding. 28

Lesson 5: Evaluating forecasting abilities 29

Lesson 6: Trading Simulator 32

Lesson 7: Creating your own models 34

Market data. 34

Model Configuration. 34

Model evolution. 34

Style. 34

3. How does Adaptive Modeler work? 35

3.1 Agent-based Model 35

3.1.1 Agent Population. 36

3.1.1.1 Trading rules 36

3.1.1.2 Order generation. 36

3.1.1.3 Margin maintenance. 37

3.1.1.4 Default management 37

3.1.2 Virtual Market 37

3.1.3 Breeding. 38

3.1.3.1 Selection of parents 38

3.1.3.2 Creating offspring. 38

3.1.3.3 Replacing agents 39

3.1.4 Model Evolution. 39

3.1.4.1 Running multiple model evolutions 39

3.2 Trading System. 39

3.2.1 Trading Signal Generator 40

3.2.2 Trading Simulator 40

3.2.3 Statistical Simulations 40

4. Market Data. 42

4.1 Data retrieval 42

4.1.1 Required quote data. 42

4.1.2 Optional quote data. 42

4.1.3 Accepted quote intervals 42

4.1.4 Quote bar timing convention. 43

4.1.5 Splits and dividends 43

4.1.6 Missing or irregular quotes 43

4.1.7 Decimal digits 43

4.1.8 Quote reading process 43

4.2 Quote file format requirements 44

4.2.1 Quote files without header 44

4.2.2 Quote files with header 44

4.2.3 Supported date formats 45

4.2.4 Supported time formats 45

4.2.5 Delimiters 46

4.2.6 Decimal separator 46

4.2.7 Thousand separators 46

4.2.8 Column headers 46

4.2.9 Interpretation of empty fields 46

4.2.10 Miscellaneous requirements 46

5. Model configuration. 48

5.1 General parameters 48

5.1.1 Quote history file of security. 48

5.1.2 Security name/description. 48

5.1.3 Model name. 48

5.1.4 Model evolution start date and time. 48

5.1.5 Market Trading Hours 48

5.1.5.1 Handling changes in Market Trading Hours 49

5.1.6 Pause model after creation. 50

5.2 Agent-based Model parameters 50

5.2.1 Population Size. 50

5.2.2 Agent Initialization. 50

5.2.2.1 Wealth distribution. 50

5.2.2.2 Position distribution. 51

5.2.3 Minimum position unit 52

5.2.4 Broker commission (for agents) 52

5.2.5 Forecast 52

5.2.6 Rounding. 52

5.2.7 Random seed. 53

5.3 Genome parameters 53

5.3.1 Maximum genome size. 53

5.3.2 Maximum genome depth. 54

5.3.3 Minimum initial genome depth. 54

5.3.4 Maximum initial genome depth. 54

5.3.5 Genome creation gene selection. 54

5.3.5.1 Genome Creation and Mutation Tester 54

5.3.6 Create unique genomes 55

5.4 Evolution parameters 56

5.4.1 Breeding cycle frequency. 56

5.4.2 Initial selection. 56

5.4.3 Minimum breeding age. 56

5.4.4 Parent selection. 57

5.4.5 Mutation probability. 57

5.5 Trading System parameters 57

5.5.1 Allow Short Positions 57

5.5.2 Significant Forecast Range. 57

5.5.3 Generate Cash Signal when forecast is outside range. 58

5.5.4 Apply FDA Filter 58

5.5.5 Start Capital 58

5.5.6 Enable Trading Simulator 58

5.5.7 Auto start at bar 58

5.5.8 Fixed Broker Fee. 58

5.5.9 Variable Broker Fee. 58

5.5.10 Average bid/ask spread. 58

5.5.11 Average slippage or price improvement 59

5.6 Saving and restoring model configurations 59

5.6.1 Default configuration. 59

6. User Interface. 60

6.1 Controlling model evolution. 60

6.2 Data series tree view. 60

6.3 Charts 61

6.3.1 Adding charts 61

6.3.2 Adding data series to an existing chart 61

6.3.3 Removing charts 61

6.3.4 Removing data series from a chart 61

6.3.5 Scrolling through charts 61

6.3.6 Maximizing a chart 62

6.3.7 Data series names 62

6.3.8 Adding a moving average. 62

6.3.9 Adding an autocorrelation indicator 62

6.3.10 Changing parameters 62

6.3.11 Showing the data overlay. 62

6.3.12 Linking charts 63

6.3.13 X-axis for time series charts 63

6.3.13.1 Chart period. 63

6.3.13.2 Positioning and meaning of X-Gridlines 64

6.3.13.3 X-axis labels 64

6.3.14 X-axis for distribution series charts 64

6.3.14.1 Histogram bin size. 64

6.3.14.2 Bin range shown. 64

6.3.14.3 Positioning and meaning of X-gridlines and labels 64

6.3.15 Y-axis 65

6.3.15.1 Y-axis scaling. 65

6.3.15.2 Y-axis labels 65

6.4 Current Values 65

6.5 Trading Signals 65

6.6 Population Window. 65

6.6.1 Scatter plots 66

6.6.2 Density charts 66

6.6.3 Using the Z (color) dimension. 66

6.6.4 Changing the axes ranges 66

6.6.5 Changing the gridline intervals 67

6.6.6 Showing the data overlay. 67

6.6.7 Showing correlation and regression. 67

6.6.8 Setting the agent dot size. 67

6.7 Performance Overview. 67

6.7.1 Settings 67

6.7.1.1 Calculation Period. 67

6.7.1.2 Compounding Period (sub period size) 68

6.7.1.3 Risk Free Rate. 68

6.7.1.4 VaR Confidence Level 68

6.7.2 Status information. 68

6.7.3 Performance calculation. 68

6.7.4 Sub period information. 68

6.8 Market Depth. 69

6.9 Agent Window. 70

6.9.1 Showing an agent’s genome. 70

6.10 Logger 70

6.11 Customizing the User Interface. 71

6.11.1 Showing a window. 71

6.11.2 Maximizing a window. 71

6.11.3 Hiding or closing a window. 71

6.11.4 Resizing windows 71

6.11.5 Moving windows 71

6.11.6 Reordering tabs 71

6.11.7 Creating window instances 71

6.11.8 Deleting a window instance. 72

6.11.9 Renaming a window instance. 72

6.12 Styles 72

6.12.1 Default style. 72

6.13 Computation performance issues 73

7. Trading. 74

7.1 Evaluating forecasting success 74

7.2 Using the Trading Simulator 74

7.3 Statistical Simulations 75

8. More about data series 76

8.1 Parameters 76

8.1.1 Calculation period. 76

8.1.2 Calculation method. 77

8.1.3 Compounding period. 77

8.2 Moving Averages 78

8.3 Autocorrelation. 78

8.4 Recomputable vs. non-recomputable data series 79

8.5 Memory limitations 79

9. Exporting data. 81

9.1 Export Settings 81

9.1.1 Selecting data series to export 81

9.1.2 Selecting the export file. 81

9.1.3 Export historical values 81

9.1.4 Auto Export 82

9.2 Other Export issues 82

9.2.1 Adding data series to the selection. 82

9.2.2 Removing data series from the selection. 82

9.2.3 Exporting distribution data series 82

9.2.4 Styles 82

9.2.5 At what point in the Agent-based Model cycle are values exported? 83

9.2.6 Date and time values in the export file. 83

10. Batch processing and automation. 84

10.1 Creating a batch process 84

10.1.1 Batch name. 84

10.1.2 Batch description. 84

10.1.3 Quote file(s) 84

10.1.4 Number of models per security. 84

10.1.5 Configuration. 85

10.1.6 Style. 85

10.1.7 Run numbers start value. 85

10.1.8 Run models until end of quote file. 85

10.1.9 Run models for a given number of bars 85

10.1.10 Export data at end of run. 85

10.1.11 Save models at end of run. 86

10.1.12 Pause models at end of run. 86

10.1.13 Close models at end of run. 86

10.2 Starting a batch. 86

10.3 Saving and opening batch settings 86

10.4 Starting a batch from the command line. 86

10.5 Updating a model 87

Appendices 88

I. Data series reference. 89

I.1 Security data series 89

I.1.1 Price. 89

I.1.2 Bid and Ask 89

I.1.3 Spread. 89

I.1.4 Volume. 89

I.1.5 Bar Return. 89

I.1.5.1 Return. 89

I.1.5.2 Log Return. 89

I.1.5.3 Absolute Return. 90

I.1.5.4 Absolute Log Return. 90

I.1.5.5 Return Distribution. 90

I.1.6 Return. 90

I.1.7 Volatility. 91

I.1.7.1 Weighted Volatility. 91

I.1.7.2 Historical Volatility. 91

I.1.8 Hurst Exponent 92

I.2 Agent-based Model data series 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 remaining. 93

I.2.2.4 Sell Orders remaining. 93

I.2.3 Price. 93

I.2.3.1 VM Price. 93

I.2.3.2 VM Bid and Ask 94

I.2.3.3 VM Spread. 94

I.2.3.4 Best Agents Price. 94

I.2.4 VM Volume. 94

I.2.5 VM Trades 95

I.2.6 Bar Return. 95

I.2.7 VM Return. 95

I.2.8 VM Volatility. 95

I.2.9 Forecast 95

I.2.10 Forecast Accuracy. 95

I.2.10.1 Forecasted Price Change. 95

I.2.10.2 Forecast Error 96

I.2.10.3 Mean Absolute 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 Forecasted Price Changes 97

I.2.10.7 Forecast Directional Accuracy. 97

I.2.10.8 Single Bar FDA. 99

I.2.10.9 Forecast Directional Significance. 99

I.2.10.10 Forecast Directional Area Under Curve (FD AUC) 100

I.2.11 Filtered Volatility. 101

I.2.12 Population. 101

I.2.12.1 Population Size. 102

I.2.12.2 Average Agent Age. 102

I.2.12.3 Age Distribution. 102

I.2.12.4 Average Agent Wealth. 102

I.2.12.5 Wealth Distribution. 102

I.2.12.6 Stdev Agent Wealth. 102

I.2.12.7 Population Cash. 103

I.2.12.8 Population Position. 103

I.2.12.9 Position Distribution. 103

I.2.12.10 Breeding fitness return distribution. 103

I.2.12.11 Breeding fitness excess return distribution. 103

I.2.12.12 Replacement fitness return distribution. 103

I.2.12.13 Replacement fitness excess return distribution. 103

I.2.12.14 Trade Duration Distribution. 103

I.2.12.15 Volatility Distribution. 104

I.2.12.16 Beta Distribution. 104

I.2.12.17 Generation Distribution. 104

I.2.12.18 Offspring Distribution. 104

I.2.12.19 Parents 104

I.2.12.20 Terminations 104

I.2.12.21 Creations 104

I.2.12.22 Defaults 104

I.2.12.23 Margin Calls 104

I.2.12.24 Genome Size. 104

I.2.12.25 Genome Depth. 105

I.2.12.26 Average Nodes Crossed. 105

I.2.12.27 Average Nodes Mutated. 105

I.2.12.28 Mutations 105

I.2.13 Agent 105

I.2.13.1 Wealth. 105

I.2.13.2 Position. 106

I.2.13.3 Cumulative return. 106

I.2.13.4 Cumulative excess return. 106

I.2.13.5 Breeding fitness return. 106

I.2.13.6 Breeding fitness excess return. 106

I.2.13.7 Replacement fitness return. 106

I.2.13.8 Replacement fitness excess return. 107

I.2.13.9 Trade Duration. 107

I.2.13.10 Volatility. 107

I.2.13.11 Beta. 107

I.2.13.12 Offspring. 107

I.3 Trading System data series 108

I.3.1 Signal 108

I.3.2 Trading Simulator 108

I.3.2.1 TS Wealth. 108

I.3.2.2 TS Position. 108

I.3.2.3 TS Trades 109

I.3.2.4 TS Return. 109

I.3.2.5 Volatility. 109

I.3.2.6 Beta. 109

I.3.2.7 Alpha. 110

I.3.2.8 Value at Risk (VaR) 110

I.3.2.9 Relative VaR. 111

I.3.2.10 Sharpe Ratio. 111

I.3.2.11 Sortino Ratio. 111

I.3.2.12 Risk-adjusted Return. 112

I.3.2.13 Maximum Drawdown. 112

I.3.2.14 MAR Ratio. 113

I.3.3 Statistical Simulations 113

I.3.3.1 Introduction. 113

I.3.3.2 Historical Simulation. 114

I.3.3.3 Monte Carlo Simulation. 114

II. Command line syntax 116

III. Genetic programming in Adaptive Modeler 117

III.1 General introduction to genetic programming. 117

III.2 Genetic programming in Adaptive Modeler 118

III.2.1 Differences between Adaptive Modeler and conventional GP. 118

III.2.2 Input of the trading rules 118

III.2.3 Output of the trading rules 118

III.2.4 Defined types 119

III.2.4.1 Advice. 119

III.2.4.2 Position. 119

III.2.4.3 Limit 119

III.2.4.4 Direction. 119

III.2.4.5 Leverage. 119

III.2.4.6 Quote. 119

III.2.4.7 Volume. 120

III.2.4.8 Market 120

III.2.4.9 Change. 120

III.2.4.10 Lag. 120

III.2.4.11 Boolean. 120

III.2.5 Function and terminal set 120

III.2.5.1 CurPos 121

III.2.5.2 LevUnit 121

III.2.5.3 FullLev. 121

III.2.5.4 Rmarket, Vmarket 121

III.2.5.5 Long, Short, Cash. 122

III.2.5.6 Bar 122

III.2.5.7 InvPos 122

III.2.5.8 RndPos 122

III.2.5.9 RndLim. 122

III.2.5.10 MktOrder 122

III.2.5.11 open, high, low, close. 122

III.2.5.12 bid, ask 122

III.2.5.13 average, min, max 123

III.2.5.14 volume. 123

III.2.5.15 avgvol, minvol, maxvol 123

III.2.5.16  >. 123

III.2.5.17 change. 123

III.2.5.18  +. 123

III.2.5.19 dir 123

III.2.5.20 isupbar 123

III.2.5.21 upbars 124

III.2.5.22 bsmin, bsmax 124

III.2.5.23 volat 124

III.2.5.24 rsi>=80, rsi<=20. 124

III.2.5.25 sk>sd, sk<sd. 124

III.2.5.26 ema. 124

III.2.5.27 mfi>=80, mfi<=20. 124

III.2.5.28 pos 125

III.2.5.29 addpos 125

III.2.5.30 lim. 125

III.2.5.31 advice. 125

III.2.5.32 and, or, not 125

III.2.5.33 if 125

 

 


1. Introduction

Adaptive Modeler is an application for creating agent-based market simulation models for price forecasting of real world market-traded securities such as stocks, ETFs or forex currencies.

 

1.1 Agent-based models and financial markets

An agent-based model is a bottom-up simulation of the actions and interactions of multiple autonomous entities for the purpose of analysing the (emergent) effects on a system as a whole. An agent-based model of a financial market consists of a population of agents (representing investors with their own assets and trading strategy) and a price discovery mechanism (representing a market).

 

Agent-based models have shown to be able to simulate complex systems such as stock markets better than traditional mathematical finance. Conventionally, financial markets have been studied using analytical mathematics based on a generalization of market participants and other simplifications and idealizations. However, the behavior of financial markets as observed in reality can not be fully described by such mathematical models. In reality, market prices are established by a large diversity of investors with different decision making methods and different investment goals (such as risk preference and time horizon). The complex dynamics of these heterogeneous investors and the resulting price formation process require a simulation model of multiple heterogeneous agents and a virtual market.

 

Research has shown that complex behavior as seen in actual markets can emerge from simulations of agents with relatively simple decision rules. Furthermore, commonly observed “stylized facts” of financial time series (such as fat tails in return distributions and volatility clustering) that have confronted the Efficient Market Hypothesis, have been reproduced in agent-based market models.

 

1.2 How Adaptive Modeler uses agent-based models

Adaptive Modeler creates an agent-based market model for a user-selected real world security. The model consists of a population of thousands of agents each with their own technical trading rule and a virtual market. Adaptive Modeler then evolves this model step by step while feeding it with historical prices of the security. After every received price, the agents evaluate their trading rule and place buy or sell orders on the Virtual Market where a clearing price is calculated and orders are executed. Agents and their trading rules evolve through adaptive genetic programming. Agents with poor performance are being replaced by new agents whose trading rules are being created by recombining and mutating trading rules of agents with good performance.

 

Self-organization through the evolution of agents and the resulting price dynamics drives the model to learn to recognize and anticipate recurring price patterns while adapting to changing market behavior. Model evolution never ends. When all historical prices have been processed, the model waits for new price data to become available and then evolves further. The model thus evolves in parallel with the real world market. After every processed price the model generates a forecast for the next bar (or tick) based on the behavior of the Virtual Market. Trading signals are generated based on the forecasts and the user’s trading preferences. 

 

1.3 Adaptive Modeler’s possibilities

Models generate trading signals for a single selected security. Trading signals are based on 1-bar-ahead (or 1-tick-ahead) price forecasts that are calculated after every received quote bar (or tick). Adaptive Modeler supports any quote interval ranging from 1 millisecond to multiple days or variable intervals. The only limiting factors are the available quote data and processing speed.

 

Adaptive Modeler uses evolutionary computation and learns over time. This means that a sufficient number (several thousands) of historical quotes of the selected security are needed. Also, only after a sufficient number of quotes has been processed, any statistical significance can be attributed to demonstrated forecasting success.

 

Adaptive Modeler is primarily designed for active trading of stocks or stock indices (i.e. using futures or ETFs) with sufficient volatility and small spreads. Other securities such as forex currency pairs or commodities can also be used because in principle Adaptive Modeler can process any sort of time series. In general however, the volatility on the used quote interval must be high enough to cover transaction costs (broker commissions, spread and slippage). If not, (simulated) trading performance will be poor even with high forecasting accuracy. For instance it will be more difficult to achieve good performance with a 1-minute interval than with a daily interval because the 1-minute price changes may be too small to cover transaction costs. This means that the break-even forecast success rate for a 1-minute interval is higher than for a daily interval.

 

Adaptive Modeler provides an extensive set of output data and visualization tools to observe the historical evolution of a model, its present behavior and the accuracy, consistency and significance of previous forecasts and trading signals. Also it is possible to simulate trading and to project the likely range of returns under given assumptions. Extensive performance analysis is available to study risk and return measures of the simulated trades. However, as for any system that aims to make predictions about the future, there is no guarantee that any demonstrated forecasting success or trading performance will remain the same in the future. Past performance or results implied, shown or otherwise demonstrated by Adaptive Modeler cannot guarantee future performance or results. The user should be aware of this and consider the risks and potential rewards of every investment or trading decision on its own merits.

 

Trading can be simulated according to user customizable trading parameters such as enabling/disabling short positions, expected spread and slippage, etc.

 

Adaptive Modeler does not contain built-in market data feeds nor does it contain interfaces for automatic order placement with online brokers. Market data is imported from ASCII (CSV) files and output data such as forecasts and trading signals can be exported to CSV files for further processing by other applications.

 


1.4 Specifications

 

Some specifications and limitations of the different editions of Adaptive Modeler[1]:

 

Feature

Evaluation Edition

Standard Edition

Professional Edition

Forecasts and trading signals

delayed[2]

real-time

real-time

Maximum number of agents

2,000

10,000

100,000

Maximum genome size

4,096

4,096

4,096

Maximum genome depth

20

20

unlimited[3]

Maximum bars per model

20,000

20,000

unlimited[4]

Maximum bars stored[5]

20,000

20,000

100,000

Auto Export

No

No

Yes

Manual Export (max bars)

500

99,999

99,999

Batch Mode (max models)

4[6]

unlimited[7]

unlimited7

 

 

1.5 System requirements

The minimum system requirements for running Adaptive Modeler are:
- Windows 7, Vista, XP, 2000 or NT 4.0
- Microsoft .Net Framework 2.0 or higher (will automatically be installed during installation of Adaptive Modeler if not present yet)
- 512Mb RAM (supports up to 20,000 agents; for 100,000 agents 1Gb RAM is required)

Other requirements:
- (historical) market data of the security to be modeled

Recommended:
- market data feeds, downloaders and/or conversion tools that retrieve market data and export it to Comma Separated Values (CSV) ASCII text files
- fast CPU

For simultaneously running multiple instances of Adaptive Modeler using the same quote file the following additional requirements apply:
- for Windows 2000: SP3
- for Windows XP: SP1

 


1.6 Installation

To install Adaptive Modeler:

1. Uninstall any previous installation of Adaptive Modeler first.
2. Download Adaptive Modeler from the download section of the Altreva website.
3. Unzip the downloaded file.
4. Launch Setup.exe and follow the instructions on screen.

Note: Before installing Adaptive Modeler, the installer checks if Microsoft .Net 2.0 or higher is installed. If this is not the case, Microsoft .Net will be downloaded from Microsoft and installed first (after your consent). This requires an internet connection and may take a few minutes. Administrator privileges may be required to install Adaptive Modeler and/or Microsoft .Net.

 

1.7 Conventions and terminology

1.7.1 “Securities” and “shares”

The term “security” is used in Adaptive Modeler for the financial instrument that is being forecasted which can be a stock, ETF, forex pair, commodity, bond, future or something else. The term “shares” in Adaptive Modeler is used for security units and depending on the security type could refer to stock shares, currency units, contracts, etc.

 

1.7.2 Market data

Adaptive Modeler accepts both OHLC (open/high/low/close) bars and tick data. In either case the term “bar” or “quote” is often used to indicate a set of prices (i.e. open/high/low/close or bid/ask/close) that form one row in a quote file. The term “bar” is also used to indicate the time interval of a single quote bar (the quote interval) or to indicate a processing step. The term “close” is used to indicate the close price in case of OHLC bars or the trade price in case of tick data.

 

1.7.3 Currency

Adaptive Modeler does not use a currency symbol for money amounts. The currency of amounts such as start capital, costs, prices, etc. does not need to be specified and can thus be interpreted as the base currency of your choice.

 

All money amounts in Adaptive Modeler are considered to be of the same currency (except of course price related data when modeling foreign exchange prices and the quote currency of the currency pair is not the user’s base currency).

 

To model a non-forex security that is denominated in another currency than the user’s base currency, the security prices need to be converted to the base currency before importing quotes, otherwise changes in the exchange rate would not be accounted for.

 

1.7.4 Dates

By default, Adaptive Modeler uses the US date convention (mm/dd/yy) for showing dates on screen and for exporting data to files. This date format can be changed to the European date convention (dd/mm/yy) through “Options…” from the “Tools” menu. Be aware that this date format has no effect on importing quotes. The date format used in the quote file (see Supported quote file formats) can be different than the date convention used for showing dates on screen and for exporting.

 

1.8 How to use this User’s Guide?

 

A Getting Started Tutorial is provided in chapter 2 for learning the basics of Adaptive Modeler. Chapter 3 describes the inner workings of Adaptive Modeler in more depth. This chapter does not necessarily need to be read before the other chapters. Chapter 4 explains how to import market data in Adaptive Modeler and the supported file formats. Chapter 5 describes in detail how to configure a model and chapter 6 describes the various elements of Adaptive Modeler’s user interface. Some issues about trading are discussed in chapter 7. Chapters 8 to 10 deal with some advanced features such as exporting data and batches. Additional information is provided in appendices.

 

1.9 Getting help

Adaptive Modeler includes a help system that provides context-sensitive help in several parts of the application. When a help button (“?”) is shown in the top-right corner of a dialog box, context-sensitive help is available. By clicking the help button, a question mark will appear next to the mouse cursor. By clicking with the question mark on the desired element in the dialog box, the relevant section of the User’s Guide will be shown in a separate Help window. Alternatively, F1 can be pressed to get help for the active text box or control.

 

Context-sensitive help is available for:

 

In other parts of the application, the User’s Guide can be launched by clicking the help (“?”) button in the toolbar or by pressing F1.

 

Note: By pressing CTRL-F in the Help window, a search box will appear.

 

1.10 Examples

The examples that are presented in the Startup window demonstrate some of the possibilities of Adaptive Modeler. Besides the short descriptions given in the Startup window, they are not explained in detail and may not be self-explanatory to new users. To start learning how to use Adaptive Modeler, it is recommended to follow the Getting Started Tutorial.

 

Advanced users can use the Styles and/or Configuration files that are used by the examples for their own models. They can be found in the Styles and Configuration folders. (The examples themselves are implemented as batch files).


2. Getting Started Tutorial

                                             

This tutorial covers Adaptive Modeler’s basic concepts and features. It shows how to create and configure a new model, how to follow its evolution with various charts and indicators, and how to evaluate forecasting abilities and trading performance. More advanced features are outside the scope of this tutorial and are explained elsewhere in this User’s Guide. Chapter 1 of the User’s Guide is considered a prerequisite.

 

The S&P500 index is used as an example case. It has been chosen for its stock market index leadership position, its long record of historical quotes and the existence of a deep futures market as well as a closely correlated and highly liquid ETF (SPY). A quote file containing the historical daily quotes of the S&P500 cash index since 1950 is included[8].

 

Note: The screen shots show what you need to do, not the results. In some cases your screen may look slightly different than the screen shots due to version differences.

 

Lesson 1: Model configuration

To create a new model in Adaptive Modeler:

 

*      Start Adaptive Modeler

 

*      Click “New” in the Startup window

 

The “New Model” dialog box will open, showing the “General” tab. The first thing to do is to select the quote file of the security that we are going to model. In this case we will use the included S&P500 index quote file.

 

*      At “Quote file of security”, click the “Browse…” button

 

 

 

*      In the “Browse” dialog box, open “S&P500 (Day).csv” (in the Samples folder)

 

The quote file is now preprocessed to automatically detect the quote interval and some other settings. Note that the “Model evolution start date/time” is automatically set near the start of the quote file.

 

 

*      Near the bottom of the dialog box, check “Pause model after creation”

 

 

 

This will allow us to observe the model’s initial state before starting model evolution.

 

 

*      Select the “Model” tab

 

 

 

The “Model” tab contains various parameters which we will leave at their default values. Note that the population will contain 2000 agents. We will also leave the tabs “Genomes” and “Evolution” unchanged.

 

 

*      Select the “Trading System” tab

 

 

 

In the top-left you will see that “Allow short positions” is checked by default. This means that long, short and cash positions can be advised (versus only long and cash positions). In the “Trading Simulator” area, note that “Auto start at bar” is checked and that the text box contains “2500”. This means that the built-in trading simulator will start trading automatically after 2500 quote bars (the first 2500 bars can be considered a “training” period in this case). We will leave these settings as they are.

 

In the “Broker commission, spread and slippage” area we need to enter realistic transaction costs for the Trading Simulator. For SPY the spread is usually 1 cent which is about 0.01% of its value.

 

*      At “Average bid/ask spread %”, enter “0.01”

 

 

 

We will leave the other values unchanged. This concludes our model’s configuration.

 

Lesson 2: Model initialization

You are about to create and initialize the model:

 

*      Click the “Create Model” button of the “New model” dialog box

 

After clicking “Create Model” the model will be created and initialized. In this case, a population of 2000 agents is created and each agent is given a random trading rule, a starting capital of 100,000 in cash and no shares (shares in this case are fictitious “S&P500 index” shares). Model initialization takes only a short time and is only visualized by a progress bar.

 

When model initialization is complete, the following windows have appeared:

·        Data Series: an expandable tree view with all of Adaptive Modeler’s data series (more about this later)

·        Current Values: some values at the current point in model evolution (such as the number of bars that have been processed which is still zero now)

·        Trading Signals: a list of recent trading signals (still empty now)

·        Charts: several charts such as the S&P500 index price (most charts are still empty now)

 

This is the default “style” of Adaptive Modeler. A style is a workspace layout that includes various presentation settings and preferences. For now however, we are going to use another style that was specifically designed for this tutorial:

 

*      From the “File” menu, choose “Apply Style…”

 

 

 

*      In the “Open” dialog box, open “Tutorial.aps” (in the Styles folder)

 

The workspace has now been changed. The Charts window is now called “Model” and contains some other charts.

 

Tip: You can disable the Tool Tips that keep popping up when you move the mouse across the screen by going to the “Tools” menu, select “Options…” and uncheck “Show User Interface Tool Tips”.

 

Let’s take a brief look at the initial state of the model before starting model evolution.

 

As said, all agents own 100,000 in cash and 0 shares. This is visible in the “Wealth Distribution” histogram chart in the top-left of the Model window. This histogram is now showing a single bar representing 2000 agents that all have a wealth of 100,000.

 

Because all agents have 0 shares at this point, their “position” is 0%. This is shown in the “Position Distribution” histogram chart (top-center). The position of an agent is the value of the shares it owns as a percentage of its wealth. A negative value indicates a short position.

 

The top-right chart is a “Genome Size Distribution” histogram. Genomes are the trading rules of agents. The chart already shows that agents have trading rules of different size. The size is measured in the number of “genes” that the genome consists of. Genes are the elementary functions and values that trading rules are constructed of. The average genome size is shown in yellow on the X-axis. Later we will look at individual agents and their trading rules in more detail.

 

Since you will be using this model throughout the rest of this tutorial, it is a good idea to save it now in case you need to revert to this point later.

 

*      Select “Save” from the “File” menu and save the model at a location of your choice

 

Now that we are familiar with the initial state of the model, we are ready to start model evolution.

 

Lesson 3: Model evolution

The model is ready to start its evolution. During evolution the model will process the historical quotes in the quote file as live streaming data. Every quote bar is processed only once and in chronological order. (Model evolution doesn’t end when the quote file ends or when present day is reached. It continues when new quotes are added to the quote file and there is no difference between the way historical and new quotes are processed).

 

We will first go through model evolution step by step, feeding it one quote bar at a time:

 

*      In the toolbar, click the “step”   button (or press F4)

 

 

 

The model now evolves one step, starting at the “Model evolution start date/time” as specified in the model configuration. At every step a quote bar is read from the quote file[9] and all agents evaluate their trading rule and place a buy or sell order on the Virtual Market. The Virtual Market (“VM”) calculates the clearing price and executes all executable orders. The clearing price (“VM Price”) is then taken as the forecast for the close of the next bar and a new trading signal is given if necessary. This process is repeated for every imported quote bar. A step usually takes only a fraction of a second.

 

Let’s see what exactly has changed after this first step. The first values have appeared in the charts “Buy Orders”, “Sell Orders”, “VM Trades”, “VM Volume” and “VM Price”. These reflect the numbers of buy and sell orders that have been placed, the resulting trades and the clearing price. More detailed market information such as market depth is also available but to keep things simple this is not covered in this tutorial.

 

The “Wealth Distribution” and “Position Distribution” histograms now show different wealth and position values for agents as a result of changes in their portfolios.

 

The forecast (which equals the VM Price) is shown in the Current Values window and also drawn in the bottom-right chart (in red). This chart also shows the security’s price in yellow (the S&P500 index in this case). A trading signal has been generated depending on whether the forecast is above or below the last security price and is shown in the Trading Signals window. The trading signal is also drawn in the bottom-right chart (in white) as an up or down arrow for “Long” or “Short” signals or a small circle for “Cash” signals[10].

 

Note: Depending on available space, the security price is shown in the chart as close lines or as OHLC price bars.

 

Tip: You can maximize a chart or entire window to get a better view by clicking the “maximize”  button near its top-right corner. Maximized charts or windows can be de-maximized with the “de-maximize”  button. Depending on your screen size, you may want to maximize a chart or window at some points during this tutorial.

 

 

*      Press F4 (or click the “step”  button) some more times while observing the charts

 

You will see the Virtual Market activity unfold further as new orders are placed by agents. The number of buy and sell orders and trades varies per bar. At every step a forecast for the next bar’s closing price is made. New trading signals will be given when necessary. Because Adaptive Modeler makes a bar-ahead forecast every bar (attempting to predict the direction of bar-to-bar price changes) new signals are sometimes given almost every bar.

 

Model evolution can also proceed continuously. Use the “resume”  and “pause”  buttons to resume/pause model evolution. You can also use the F3 key to resume/pause model evolution.

 

*      Press F3 a couple of times to resume and pause model evolution

 

We will now let the model evolve until about 1000 bars. You can see how many bars have been processed in the Current Values window. Use pause/resume (F3) or step (F4) at will. Take your time and observe the charts.

 

*      Evolve the model until about 1000 bars have been processed and then pause it again

 

Note: Especially during the early (“learning”) stages of model evolution, forecasts sometimes strongly diverge from the security price. Later the forecasts usually tend to stay closer to the security price. Therefore, the Trading Simulator is usually started after a learning period of a number of bars. Adaptive Modeler also offers ways to filter out strongly diverging forecasts (see Significant Forecast Range).

 

You may have noticed that after 80 bars the “Genome Size Distribution” also started to change. This is caused by replacement of agents and their trading rules by new agents through breeding. We will deal more with this later.

 

Also note that the “Population Position” chart (bottom-center) shows the course of the average position of all agents over time.

 

Note: In case you failed to pause the model around 1000 bars and the model has already evolved much further, you can revert to the model saved at the end of Lesson 2 and try again in order to keep the model in sync with this tutorial. Saving the model at the end of every lesson is recommended for reverting when needed.

 

Controlling Charts

Because older information disappears from the left side of charts during evolution, the charts are now only showing the last quarter of history. This is indicated in the “Chart period” dropdown box in the main toolbar which shows “Quarter”. You can change the chart period to view longer periods:

 

*      In the main toolbar, click on the “Chart period” dropdown box and select “Year”

 

 

 

All the charts (except the distribution histograms) will now show one year of history.

 

*      In “Chart period” dropdown box, select “5 years”

 

Now all the model’s evolution history so far should be visible.

 

*      In “Chart period” dropdown box, select “Quarter” again

 

To look back at older information without zooming out and losing details, you can simply scroll the charts horizontally:

 

*      On the “VM Price” chart’s plot area, click and hold down the left mouse button and drag the chart to the right to see its history

 

 

 

When you do this, all the charts will scroll in sync (except the distribution histograms). When you are done viewing the history:

 

*      Drag the chart back to its most recent value again (or click the > button near the top-right corner to jump there directly)

 

 

 

Note: A chart must be showing its most recent value in order to scroll automatically during model evolution. (When the most recent value is shown, the < and > buttons are not shown). To learn more about using charts, see Charts.

 

Lesson 4: Agents

In an agent-based model the most interesting phenomena are generally seen on the population level rather than in individual agents. The purpose of an agent-based model is to study emergent behavior caused by the interaction of many (relatively simple) agents. Likewise, we are more interested in the forecasts (Virtual Market prices) that result from our model than in the life and times of individual agents.

 

However, it is important to know what agents are and how they operate and interact to understand how they influence their environment (the market) and the forecasts. In this lesson we will therefore first look at the details of individual agents and then look at the population as a whole again.

 

Viewing agent details

To get detailed information of an agent:

 

*      From the “View” menu, choose “Agent” and then “Agent 1”

 

 

 

A window titled “Agent 1” has now appeared (bottom-left) showing the following information of agent number 1:

·        Age: number of bars processed since agent creation

·        Cash: amount of cash owned by agent

·        Shares: number of shares owned by agent (negative for short position)

·        Wealth: total wealth of an agent (value of cash and shares)

·        Position: value of shares as a percentage of wealth (negative for short position)

·        Cumulative (excess) return: return since agent creation (excess of security’s return)

·        Breeding fitness (excess) return: a short term trailing return measure (selection criterion for breeding)

·        Replacement fitness (excess) return: average (excess) return per bar (selection criterion for replacement)

·        Trade duration: average number of bars between trades (indicator of an agent’s investment/trading horizon)

·        Volatility: volatility of agent wealth (indicator of absolute risk of an agent’s investment/trading style)

·        Beta: correlation of agent wealth with security price (indicator of relative risk of an agent’s investment/trading style)

·        Generation: genealogical generation number of agent

·        Offspring agents: number of offspring agents this agent has produced

·        Genome size: size of genome (trading rule) in number of genes

·        Genome depth: number of hierarchical levels in genome

 

 

*      Evolve the model until about 1300 bars (use F3 and/or F4) and watch the agent values change

 

You may notice that Age is sometimes reset to 1. This means that the agent has been replaced by a new agent in the breeding process. In fact, the Agent window shows “slots” in the population. Also note that some agent values only become available when the agent has reached a certain age.

 

*      Look at some other agents by changing the agent number in the Agent window’s toolbar (by typing or by using the up and down buttons or keys)

 


Agent charts

Most agent values can also be followed in charts:

 

*      Click on the “Agents” tab (below the charts)

 

 

 

In this window, a chart with the wealth history of agent 1 is already showing. We will add some more charts:

 

*      In the Data Series window, expand the “Agent-based Model” category

 

*      Expand the “Agent” subcategory

 

 

 

In the “Agent” subcategory you will see various agent data series such as “Agent Wealth” and “Agent Position”. To watch the trading activity of an agent:

 

*      In the Data Series window, double-click on the “Agent Position” data series name

 

 

 

A dialog box “Edit Data Series Parameters” will appear where you can enter the agent number to show:

 

*      Enter “1” in the text box and press ENTER (or click “OK”)

 

 

 

 

A new chart showing the position history of agent 1 has now been added to the Agents window. It doesn’t contain any history yet because this information is not stored for all agents. During model evolution new information will appear in this chart. With this chart it is easy to see the trades of an agent from the changes in its position.

 

You can also show information of multiple agents in one chart:

 

*      From the Data Series window, drag and drop the “Agent Wealth” data series name into the chart “Agent Wealth (1)”

 

 

 

*      Enter “2” in the “Edit Data Series Parameters” and press ENTER

 

The wealth history of agent 1 and agent 2 are now shown together in one chart.

 

*      From the Data Series window, drag and drop “Agent Position” into the “Agent Position (1)” chart, enter “2” in the dialog box and press ENTER

 

The position history of agent 1 and agent 2 are now shown together in one chart.

 

 

*      Evolve the model until about 2000 bars and watch the agent charts

 

You may notice a gray dot appearing in the agent charts occasionally. This indicates agent replacement[11].

 

Tip: You can show any data series from the Data Series window in a chart in the ways shown above. Up to eight data series can be combined in one chart.

 

Trading rules

From the Agent window, you can also view an agent’s trading rule.

 

*      In the Agent window’s toolbar, click the “Show genome”  button

 

 

 

A window will appear showing the agent’s trading rule. Explaining the trading rules is outside the scope of this tutorial. To learn more, see Showing an agent’s genome or Trading Rules.

 

*      When you are done viewing the trading rule, close the trading rule window

 

*      Close the Agent window by clicking the x button in its top-right corner

 

 

 

Viewing the population

You are already familiar with the wealth and position distribution histogram charts. These charts give only a glimpse of the diversity of agents. A more extensive visualization of the agent population is provided by the Population window where multiple agent values can be plotted against each other.

 

*      Click on the “Population” tab (below the charts)

 

 

 

The Population window is now showing and contains a scatter plot of agent Wealth against agent Age. As is shown in the toolbar, Age is shown on the X-axis and Wealth on the Y-axis. Every dot represents one agent.

 

 

*      In the Population window’s toolbar, click the “Show Correlation and Regression”  button

 

 

 

Correlation and regression information will appear and a regression line is drawn. In general, there will be a positive correlation between Age and Wealth because evolutionary selection pressure will let successful agents stay in the population longer than unsuccessful ones.

 

 

*      In the Population window’s toolbar, click on the “Z (color):” dropdown box and select “Position”

 

 

 

The color of the agents now indicates their position; blue for long positions and red for short positions (see the legend above the plot area). During model evolution you will notice agents changing color. Some agents are holding a long position most of the time, others a short position and others frequently switch positions.

 

*      Evolve the model until about 2500 bars while watching the Population window

 

 

Let’s look at some other agent values:

 

*      In the Population window’s toolbar, click on the “X:” dropdown box and select “Trade Duration”

 

*      Click the “Show Correlation and Regression”  button again to remove correlation and regression information

 

 

 

 

Agent Wealth is now plotted against Trade Duration. Agents with low trade duration (“active traders”) are on the left and those with high trade duration (“long term investors”) are on the right.

 

*      Evolve the model until about 3000 bars and watch the Population window

 

You may notice that some agents are moving to the right as their trade duration increases with time (“long term investors”) and others are staying on the left while frequently changing their Position, as is indicated by color changes (“active traders”).

 

Hundreds of different scatter plots can be made from all the possible combinations of agent values. A quick way to see some of them is to browse through the “X:”,  “Y:” or “Z:” dropdown boxes. To ensure that the most relevant region of the plot is automatically shown for every combination, the axes ranges can automatically be set to a number of standard deviations around the mean value:

 

*      In the Population window’s toolbar, click the “X-Axis settings”  button

 

*      In the X-axis toolbar that has just appeared, click on the “Range:” dropdown box and select “stdev intervals”

 

*      In the Population window’s toolbar, click the “Y-Axis settings”  button

 

*      In the Y-axis toolbar, click on the “Range:” dropdown box and select “stdev intervals” as well

 

 

 

*      In the Population window’s toolbar, click the “X-Axis settings”  and “Y-Axis settings”  buttons once more to hide the axis toolbars

 

*      Now double-click on any of the “X:”,  “Y:” or “Z:” dropdown boxes and use the mouse wheel (or UP and DOWN arrow keys) to browse through different plots

 

*      Evolve the model until about 6000 bars while browsing through different plots at will

 

Tip: An interesting plot is “Offspring” for X, “Genome size” for Y and “Beta” for Z. The horizontal position of agents now indicates the total number of their offspring agents (which in general correlates strongly with long term return). When an agent moves to the right, it is creating offspring agents and must therefore be among the agents with highest Breeding Fitness Return (which is a short term return indicator). The Genome size itself is not of major interest here but is used to distribute agents vertically over the chart for clarity. Because the genome size doesn’t change during an agent’s life, the vertical position stays fixed which makes it easy to follow individual agents.

 

Breeding

Breeding is the process of creating new offspring agents from some of the best performing agents to replace some of the worst performing agents. At every bar, agents with the highest “Breeding Fitness Return” are selected as parents. Copies of the genomes (trading rules) of pairs of these parents are then recombined through genetic crossover to create new genomes that are given to new offspring agents. These new agents replace agents with the lowest “Replacement Fitness Return”.

 

The breeding frequency and the number of agents to be replaced can be controlled by parameters to influence the adaptability versus the stability of the model. Changing these parameters is outside the scope of this tutorial but we will look at how some of the consequences of the breeding process can be observed.

 

*      Click on the “Breeding” tab (below the Population window)

 

 

 

*      In the main toolbar, set the “Chart period” to “25 Years”

 

The “Creations” chart (top-left) shows the number of agents created per bar. After heavy initial fluctuation this value stabilizes to 20 agents (1% of the population) per bar. (This is because the number of agents that can be created/replaced depends on agent age). To keep the population size fixed, the number of replaced agents is always equal to the number of new created agents.

 

The “Avg Agent Age” chart shows the average age of all agents. This gives an indication of the level of experience present in the population. Sudden drops may indicate a sudden change in the market that resulted in a wipe-out of experienced agents. The “Age distribution” histogram shows what age groups currently exist in the population.

 

The “Avg Genome Size” shows the average size of the genomes over time. Also recall the Genome Size Distribution histogram on the Model tab. Through the process of recombining and mutating genomes for the creation of new agents, the average genome size changes. Bigger genomes may contain more complex algorithms and may be able to look back further in history but are not necessarily always better.

 

*      Evolve the model until the end of the quote file while observing the Model, Agents, Population or Breeding window at will (at any Chart period)

 

Lesson 5: Evaluating forecasting abilities

So far we have looked inside the model extensively but we have not looked at how well it is doing what it is supposed to do, the forecasting of prices. To evaluate the forecasting abilities of a model, a number of indicators are available.

 

*      Click on the “Forecasts” tab (below the main window)

 

 

 

*      In the main toolbar, set the “Chart period” to “Quarter”

 

A simple but intuitive way to observe past forecasts is provided by the “Right Forecasted Price Changes” (blue) and “Wrong Forecasted Price Changes” (red) in the top-center chart. These series show the security price using blue for price changes whose direction was forecasted right and red for those that were forecasted wrong. This visualizes how many price changes were forecasted right and wrong as well as their magnitude.

 

A more quantitative way to evaluate forecasts is provided by the “FDA” chart (top-right). FDA stands for “Forecast Directional Accuracy”. This indicator shows the percentage of bars for which the forecasted price change was in the right direction. Values above 50% indicate that more often than not the direction of price change was forecasted correctly. The chart shows a 100 day trailing FDA during the last quarter.

 

To see how the FDA evolved during the entire model history:

 

*      In the main toolbar, set the “Chart period” to “100 Years”

 

On such long time scales you may want to calculate a trailing FDA over more bars:

 

*      Right-click on the “FDA” chart

 

*      In the context menu, open the data series submenu and click “Parameters…”

 

 

 

 

 

*      In the dialog box, enter “1000” at “Trailing … bars” and click “OK”

 

 

 

The chart now shows a 1000 day trailing FDA. You may notice that FDA varies over time. Periods with good forecasting are followed by periods with poor forecasting and vice versa. To get the average FDA over the entire model history:

 

*      In the Data Series window, expand the “Agent-based Model” category and expand the “Forecast Accuracy” subcategory

 

 

 

*      In the “Forecast Accuracy” subcategory, locate the “FDA” data series and drag and drop it into the Current Values window

 

 

 

 

*      In the “Edit Data Series Parameters” dialog box, select “Since model start” and click “OK”

 

The FDA since model start is now shown in the Current Values window.

 

Tip: You can show any data series from the Data Series window in the Current Values window, in the way shown above.

 

For a more complete evaluation of forecasting abilities, other indicators in the “Forecast Accuracy” category should be observed as well. This is outside the scope of this tutorial.

 

Tip: To learn more about any data series in the Data Series window, click on (or select) the data series name and press Shift-F1.

 

To conclude whether or not a model with forecasting abilities will be useful for trading, the performance of trades based on the trading signals needs to be evaluated. This performance does not only depend on forecasting abilities but also on volatility and transaction costs. In the next lesson we will see how to evaluate performance with the Trading Simulator.

 

Lesson 6: Trading Simulator

The Trading Simulator simulates trading based on the trading signals and your personal trading preferences and is used to calculate returns and other performance indicators.

 

*      Click on the “Forecasts” tab and set the “Chart period” to “100 Years”

 

The “TS Wealth” chart (middle-left) shows the Trading Simulator Wealth[12]. To get its exact current value:

 

*      Click on the data series name (“TS Wealth”) above the chart

 

 

 

A data overlay will be shown on the chart with the value at the current bar.

 

Tip: You can get a data overlay for any data series in a chart by clicking on its name above the chart. Click once more to hide it again. To learn more, see data overlay.

 

At model creation, Trading Simulator Wealth starts with the Start Capital as specified on the “Trading System” tab of the model parameters (100,000). While the Trading Simulator is enabled, it simulates trades according to the signals. Its wealth is adjusted accordingly, taking into account the broker commission, spread and slippage settings as specified on the “Trading System” tab. Recall from lesson 1 that the Trading Simulator was set to start trading automatically after 2500 bars (around 1960).

 

Tip: You can manually enable or disable the Trading Simulator during model evolution with the “TS”  button on the main toolbar. You can also change Trading System settings and other model parameters during model evolution (click the “Edit Model parameters”  button on the main toolbar).

 

The middle-center chart shows a 1 year trailing return of the security (in yellow) together with a 1 year trailing return of the Trading Simulator (in red). The middle-right chart shows the excess 1 year trailing return of the Trading Simulator over the security[13].

 

The bottom-left chart shows the historical volatility of the security (in yellow) with the historical volatility of Trading Simulator wealth (in red). The volatility of Trading Simulator wealth is often lower than that of the security because the alternation of long, short and cash positions tends to temper volatility.

 

The bottom-center and bottom-right charts show the Trading Simulator position and its number of trades per day[14]. On a period of 100 years these charts are not very clear. We will therefore add moving averages:

 

*      Right-click on the “TS Position” chart

 

*      In the context menu, open the submenu for the data series and click “Add moving average…”

 

*      In the “Edit Data Series Parameters” dialog box enter “1000” at “Bars” and click “OK”

 

A 1000 day moving average of the Trading Simulator position has now been added to the chart (in red).

 

*        In the same way, add a 1000 day moving average to the “TS Trades” chart

 

Tip: You can add moving averages to most charts.

 

An overview of the Trading Simulator’s performance with various risk and return indicators is provided by the Performance Overview:

 

*      Click on the “Performance” tab (below the Model window)

 

 

 

The Performance Overview is now showing. You can change the calculation period and some other settings by clicking on the “Performance Calculation Settings”  button above the Performance Overview. To learn more, see Performance Overview.

 

Note: Model evolution, forecasting abilities and performance depend in part on random factors that are inherent to agent-based modeling and genetic programming. The model created in this tutorial will therefore be different every time it is created. In general it is recommended to do multiple runs with the same model parameters for a more complete overview of possible results.

 

Tip: For a more extensive analysis of the potential range of returns under varying conditions based on assumed values of FDA and volatility, the Statistical Simulations can be used.

 

Lesson 7: Creating your own models

This tutorial concludes with some guidelines for creating your own models. When creating your own models, a few things will usually be different than as shown in this tutorial.

 

Market data

Market data needs to be provided and may need to be converted to one of Adaptive Modeler’s supported formats. See 4. Market data for more information about this.

 

Model Configuration

At least the following model parameters should be checked/adjusted to correspond with the security you are modeling and your preferences (more about model configuration is explained in 5. Model configuration):

 

On the “General” tab:

 

On the “Model” tab:

 

In the “Gene Selection”:

 

On the “Trading System” tab:

 

Model evolution

By default, the “Pause model at start” option is disabled so model evolution follows immediately after initialization. Often you may want to evolve a model first until present day without interruptions and then analyze the results afterwards (also see Computation performance issues). However, if you want to observe model evolution “live” using the Population window (or other data that is not stored historically) you can use the pause, step and resume functions.

 

Style

The default style that Adaptive Modeler uses is not the same as the style that was used for this tutorial and does not contain the same charts. However, you can select any style to be the default style or even create your own default style. To learn more, see Styles.

 


3. How does Adaptive Modeler work?

Adaptive Modeler consists of two main parts: the Agent-based Model and the Trading System. In short, the Agent-based Model receives quotes and produces price forecasts and the Trading System decides when a new trading signal should be given based on the forecasts and the user’s trading preferences.

 

Adaptive Modeler Components

 

3.1 Agent-based Model

The Agent-based Model consists primarily of a population of agents and a Virtual Market where agents can trade the security. An agent is an autonomous entity representing a trader (or investor) with its own assets (cash and/or shares) and its own trading strategy.

 

After initialization, a new model starts evolving by executing its regular cycle for every received quote bar as is shown below.

 

 

After a new quote bar has been received, agents can place a new order or remain inactive according to their trading strategy. After all agents have evaluated their trading strategy, the Virtual Market determines the clearing price, executes all executable orders and releases the price forecast for the next bar. Finally, breeding of new agents and replacement (by evolutionary operations such as crossover and mutation) can take place. This process then repeats itself for the next bar.

 

Note that in most cases (depending on model settings) the agent-based model is not a closed economy. The total amount of money in the model may vary because of agent replacements[15] and because of broker commissions charged to agents. New agents get an initial wealth (according to the Agent Initialization settings) that is usually different (higher) than the wealth of the replaced agents. On average this has an increasing effect on the total amount of money. When broker commissions are charged to agents these amounts are being discarded, which has a decreasing effect on the total amount of money. The total amount of money in the model can be observed with the Population Cash data series. Also the total number of shares that exist in the model can vary because of agent replacements. New agents get an initial shares position according to the Agent Initialization settings while the shares of the replaced agent are being discarded.

 

3.1.1 Agent Population

At model initialization a population of agents is created according to the model parameters specified by the user. These parameters include the Population Size and the Agent initialization settings. The population size is generally thousands of agents. Upon creation, each agent receives a starting capital consisting of cash and/or shares depending on the distribution methods selected in the Agent initialization settings. Each agent also receives a technical trading rule (its “genome”) that is randomly created according to the Genome Settings.

 

After all initialization processes, the agent population will evaluate its trading rules, trade and breed according to the Agent-based Model cycle.

 

3.1.1.1 Trading rules

The trading rules use historical price and volume data as input and, according to their internal logic, return an “advice” consisting of a desired position (as a percentage of wealth) and an order limit price for buying or selling the security. A market order can also be indicated. The internal logic of the trading rules is built from several operators such as:

 

The trading rules are implemented with genetic programming technology. For more information about how the trading rules are constructed, see III. Genetic programming in Adaptive Modeler.

 

3.1.1.2 Order generation

Adaptive Modeler translates the output of an agent’s trading rule (the “advice”) into a buy or sell order by comparing the desired position with the agent’s current position and calculating the number of shares that need to be bought or sold. If shares need to be bought or sold, an order will be generated to buy/sell the required number of shares, using the specified limit price or market order indication.

 

Example:

An agent’s owns 1000 shares of the security and 80,000 in cash. The security’s price is 38,50. The agent’s wealth is thus 118,500 and its position is 32.5%. Its trading rule returns an advice of a position of 50% and a limit price of 38,50. A limit order will then be generated to buy 539 (= 50% * 118,500 / 38,50 - 1000) additional shares with a limit price of 38,50.

 

Some implementation details:

 

3.1.1.3 Margin maintenance

If the current position of an agent becomes less than -150% of its wealth (as a consequence of an increase in the security price), the agent will receive a “margin call”. This means that a buy order will be generated with a limit price set to 5% above the most recent price on the Virtual Market. (The desired position will be based on the current advice as normal since this is always at least -100%). Note that this mechanism does not guarantee that the short position will become higher than -150%. The number of margin calls occurring can be monitored with the Margin Calls data series.

 

3.1.1.4 Default management

If an agent's wealth becomes negative, it is forced to close any open position (regardless of available cash) by placing an order with a limit price 5% higher/lower than the most recent price on the Virtual Market. Once their position is closed, defaulted agents will be replaced in a special “defaults replacement” procedure by random created agents (if they weren't already replaced by the breeding operation). Note that defaulted agents may continue to exist as long as their position can not be fully closed and they are not being replaced by the breeding operation. It is theoretically possible that a defaulted agent (that has not yet been removed) recovers and gets positive wealth again. In that case it continues to exist as normal. The number of defaults occurring can be monitored with the Defaults data series.

 

 

3.1.2 Virtual Market

The Virtual Market is a simulated double auction market where all buy and sell orders from agents are collected. Every bar, after all agents have evaluated their trading rule and placed their order (if any), the Virtual Market calculates the clearing price. The clearing price is the price at which the highest trading volume from limit orders can be matched[16]. The Market Depth window shows the depth of the orderbook before and after clearing. There is no market maker. When the total number of shares offered (at or below clearing price) exceeds the total number of shares asked (at or above clearing price) or vice versa, the remaining orders will not be (fully) executed. In this case, orders at the clearing price will be selected for execution with priority for market orders over limit orders and then on a first‑in‑first‑out (FIFO) basis. Orders can be partially executed. In case there are no matching limit orders at all, no market orders will be executed either.

 

The forecast for the real market price can be based either on the clearing price of the Virtual Market (Virtual Market Price) or on only the buy and sell orders of a dynamically changing group of the best performing agents (Best Agents Price). In the default configuration the Virtual Market Price is used. The rationale for using the Virtual Market Price as an indicator for future prices is as follows: Because of the volume weighted clearing price computation mechanism, wealthier (more successful) agents (who will generally place bigger orders) will have a bigger influence on the market price than less wealthy (less successful) agents. This way the forecast calculation mechanism has a preference for successful trading strategies but still includes a high number of diverse trading strategies. The latter is needed to make the forecasting mechanism more robust to changes in market behavior since previously successful trading strategies are not guaranteed to remain successful in the future.

 

In some cases, using the Best Agents Price as the forecast may result in better forecasts. Other than that, it may be interesting to compare the forecasting abilities of the entire Virtual Market with those of a (much smaller) group of only the best performing agents.

 

 

3.1.3 Breeding

Breeding is the process of creating new agents to replace poor performing agents. Breeding occurs by selecting pairs of well performing agents (parents) and producing new genomes by recombination of the parent genomes through a crossover operation. In a crossover operation, the parent genomes are copied and then a randomly chosen part of the copied genome of one parent gets exchanged for a randomly chosen part of the copied genome of the other parent. The resulting two new genomes are used to create two new agents. Breeding can occur every bar or every n bars where n is the breeding cycle frequency.

 

3.1.3.1 Selection of parents

Parents are selected according to the parameters Minimum breeding age, Initial selection and Parent selection. First the initial selection is made. This is a temporary sub population in which breeding and replacement will take place. The initial selection consists of a given percentage of all agents of minimum breeding age and older. Then the p best performing agents (judged by Breeding Fitness Return) of the initial selection are selected as parents, where p is the value of Parent selection parameter. For more information about the selection process, see the parameter descriptions.

 

3.1.3.2 Creating offspring

The selected parents are randomly grouped in pairs. For each pair the crossover operator picks a random node in a copy of one parent’s genome and then selects another random node (of the same type) in a copy of the other parent’s genome. The subtrees starting at the selected nodes are then swapped. To be accepted, the resulting offspring genomes must meet the Maximum Genome Size and Maximum Genome Depth constraints and must be different than their parent genomes. If Create unique genomes is checked, the offspring genomes must also be unique within the current group of parents and offspring. If not accepted, the crossover is retried until acceptable offspring genomes have been created or a time limit is exceeded. (In some cases crossover may not be possible, resulting in less offspring agents being created). The resulting offspring genomes may then be mutated, according to the probability given in the Mutation probability parameter. Finally, two new agents are created and provided with the offspring genomes and a starting capital consisting of cash and/or shares depending on the distribution methods selected in the Agent initialization settings.

 

3.1.3.3 Replacing agents

The created offspring agents will replace the worst performing agents of the initial selection (judged by Replacement Fitness Return). Note that the number of agents that are being replaced is always equal to the number of offspring agents that have been created. This is to keep the population size stable.

 

 

3.1.4 Model Evolution

 

In the early stage of model evolution the forecast may sometimes diverge strongly from the security’s price. In this case the Virtual Market is acting chaotic because of an imbalance in supply and demand. This imbalance is caused by the fact that at model start the initial position of agents may not be in line with their trading rules. Therefore the agents first need to align their portfolio with the advice from their trading rule which can cause heavy trading volumes and big price changes.

 

As the model evolves two things will happen. First, agents that happen to have a well performing trading rule will become wealthier than less fortunate agents. Because they are wealthier they will have more influence on the Virtual Market price (the forecast) which presumably is beneficial to the accuracy of the forecast. Second, the trading rules will improve by natural selection as breeding creates new agents by crossover and mutation of the best performing agents, replacing the worst performing agents. For the purpose of selecting agents for breeding, the agent fitness is determined by the Breeding fitness return data series. For the purpose of selecting agents to be replaced (by new offspring), the agent fitness is determined by the Replacement fitness return data series.

 

The Agent-based Model is in fact a self-organizing system that evolves according to a balanced interplay of two mechanisms:

 

3.1.4.1 Running multiple model evolutions

The evolution and results of multiple models that were all based on the same historical quotes and the same model parameters can be different. This is caused by the use of random numbers which is inherent to agent-based modeling and genetic programming. Random numbers are for instance used for the creation of trading rules. Only when the same random seed values are used, multiple models will evolve in exactly the same way[17].

 

This means that for a given security and a given set of parameter values, it may be necessary to do a number of runs to get a more reliable and complete overview of results. See also Batch processing and automation.  

 

3.2 Trading System

 

The Trading System consists of the following components:

 


3.2.1 Trading Signal Generator

 

After every generated forecast, the Trading Signal Generator evaluates whether or not a signal should be generated. Trading signals are generated based on the following factors:

 

In general, when the forecast is higher (lower) than the last price (and the absolute difference is within the Significant Forecast Range) then a Long (Short) signal will be generated. However, if “Allow short positions” is disabled, a Cash signal will be generated instead of a Short signal.

 

If the forecast is equal to the last price (or the difference is outside the Significant Forecast Range) and “Generate Cash signal when forecast is outside range” is selected, then a Cash signal will be generated. If the latter is not the case, no signal will be generated.

 

A signal will only be generated when the new suggested position differs from the last generated signal. Therefore, signals remain valid until a new signal is given.

 

When “Apply FDA filter” is enabled, Trading Signals will only be generated when the Forecast Directional Accuracy (as calculated according to the specified “FDA Settings”) is higher than or equal to the specified “Threshold” (see also Forecast Directional Accuracy).

 

3.2.2 Trading Simulator

 

The Trading Simulator simulates trading according to the trading signals and the relevant Trading System parameters such as Start Capital, Broker Commission, Spread and Slippage (see 5.5 Trading System parameters).

 

When the Trading Simulator is enabled, it enters a long position in the security when a Long signal has been generated (with 100% of total capital and after closing any short position) and enters a short position when a Short signal has been generated (for 100% of total capital and after closing any long position). If a Cash signal has been generated then the Trading Simulator will hold only cash (after closing any position). When Trading is disabled the Trading Simulator will not trade (any open position will be closed first). When the Trading Simulator gets enabled, it will first open a position based on the last generated signal.

 

For more information on using the Trading Simulator, see 7.2 Using the Trading Simulator. For more information on viewing its performance see 6.7 Performance Overview. Note that all return and performance indicators in Adaptive Modeler are calculated after all costs (broker commissions, spread and slippage).

3.2.3 Statistical Simulations

 

While the Trading Simulator shows the past and present trading performance of a particular model, it does not give insight into the potential range of (future) trading returns of multiple models (runs) and its sensitivity to various factors.

 

The Statistical Simulations included in Adaptive Modeler estimate the likely range of returns given various underlying factors. The simulation tools included are Historical Simulation (HS) and Monte Carlo Simulation (MCS). Both are implemented as data series and are further described in 7.3 Statistical Simulations and I.3.3 Statistical Simulations.

 

It is important to understand that the Statistical Simulations do not use any output from the Agent-Based Model (such as forecasts or trading signals). Instead they are based on user given expectations of Forecast Directional Accuracy and Forecast Directional Significance. Additionally they are based on historical security prices (HS) or user given expectations of drift and volatility (MCS), certain Trading System parameters and (optionally) the current Trading Simulator wealth.


4. Market Data

 

Adaptive Modeler needs a sufficient amount of historical data for its evolutionary learning. Typically thousands of bars are required for consistent forecasting skills to develop. Adaptive Modeler can process both OHLC bars as well as tick data. Bid and Ask prices and Volume data can also be used. Sometimes historical data may need to be preprocessed for best results (i.e. back-adjusting of futures contracts).

 

4.1 Data retrieval

 

Adaptive Modeler reads quotes from Comma Separated Values (CSV) ASCII text files in familiar formats such as those used by popular charting and technical analysis software packages. Most data vendors and quote downloaders support exporting quotes to ASCII files. Several third party conversion tools exist as well. For example, the following data feeds can be exported to ASCII files in real-time with an additional tool:

 

 

4.1.1 Required quote data

As a minimum, the following columns are required in the quote file:

 

Note that for tick data the Close column should be used for trade prices.

 

4.1.2 Optional quote data

The following columns are optional and can be used by Adaptive Modeler:

 

Other columns may also be included in quote files (usually this requires a header) but will be ignored by Adaptive Modeler.

 

Note: if Open, High and/or Low values are not included in the quote file, the following values will be assigned to them: Open will be set equal to Close, High will be set equal to the highest of Close and Open, and Low will be set equal to the lowest of Close and Open. If Open, High, Low or other values should not be visible to agents, then the corresponding genes should be disabled in the Gene Selection.

 

4.1.3 Accepted quote intervals

Adaptive Modeler supports any quote interval ranging from 1 millisecond to multiple days provided that processing time per quote is short enough[18]. For high-frequency data, the actual usable minimum interval thus depends on situation specific factors such as CPU speed, model parameters and data retrieval latency. Usually, processing time per quote is only a fraction of a second.

 

The quote interval size is automatically detected from the quote file. Variable intervals (i.e. for constant range bars or tick data) are also supported. If a variable interval is detected, an average (rounded) interval size is calculated for practical purposes such as charting[19].

 

4.1.4 Quote bar timing convention

The time field of a bar in the quote file should indicate the bar’s closing time. For this reason, the quote file should not contain bars with the market’s opening time. For End‑of‑day files without time field, Adaptive Modeler will assign the market closing time (as set in the model parameters) to every bar.

 

4.1.5 Splits and dividends

Adaptive Modeler does not automatically adjust for splits and dividends.

As stock splits have a distorting effect on model evolution and on return calculations, the quote history file should be adjusted for splits before creating a model. When a new split occurs, a new model should be created after re-adjusting the historical quotes.

 

Whether or not historical quotes should be adjusted for dividends and by which method depends on situation specific factors and should be considered by the user. Note that return calculations in Adaptive Modeler do not include dividend payments.

 

Note that it may be necessary to change the rounding settings when historical prices have become very low after adjusting for splits and/or dividends.

 

4.1.6 Missing or irregular quotes

If a quote is found with a time other than the expected time, a notification will appear in the Logger (see 6.10 Logger). For example, quotes could be missing because of holidays, incomplete data or other reasons or quotes could be outside the regular Market Trading Hours. Missing or irregular quotes are not necessarily a problem (i.e. they could simply indicate a holiday) so normal operation will continue. However, they are being reported to the Logger so that the user can see them. By viewing the Logger, you can instantly check for missing quotes or other irregularities. For variable intervals, only notifications about quotes outside the Market Trading Hours will be reported.

 

4.1.7 Decimal digits

The number of decimal digits that imported quotes are rounded to can be specified by a model parameter (see Decimal places). After selecting a quote file in the “New Model” dialog box, Adaptive Modeler will attempt to automatically detect the number of decimal digits that are used in the quote file and set the rounding parameter. You should check this value and adjust it if necessary.

 

4.1.8 Quote reading process

As a model evolves, it will process all quotes in the quote file. When all quotes have been processed, the system will continue to read and process new quotes as soon as they are added to the quote file. There is in fact no difference between the way the system goes through historical quotes and the way it processes new quotes, except that the latter will go slower as it involves waiting for every new quote. (Note that the Evaluation Edition processes recent quotes only after a delay of a few days).

 

4.2 Quote file format requirements

 

Most quote files that use common formats will automatically be read correctly by Adaptive Modeler without conversion. When only using Open, High, Low, Close and Volume data, a header is usually not necessary. Several date and time formats are automatically recognized. It is also possible to use a header to specify the columns and the date and time formats to override automatic detection.

 

4.2.1 Quote files without header

In many cases a header is not necessary. If no header is included then only Date, Time, Open, High, Low, Close, Volume and Open Interest columns are allowed and they must be in this order (only Date and Close are required). Open, High and Low columns may only be included all or none. Open Interest may only be included if Volume is also included (but will be ignored).

 

The date format will automatically be detected. If a Time column is included, the time must use a colon to separate hours, minutes and seconds. It is also possible to combine the date and time in one column, separated by a space.

 

Some examples of valid quote rows without header (headers only shown here for illustration):

 

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

With a header, more possibilities are supported. Bid and Ask prices can be included and also other columns may be included in the quote file (but will be ignored). Columns may be in any order and Open, High and Low columns may be included or excluded in any combination. The date and time format can (optionally) be specified exactly in the header to override automatic detection and avoid any ambiguities. Also time formats without colons are supported such as “hhmm”.

 

Some examples of valid quote rows with 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

 

<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 date formats are supported. Some examples of supported date formats (not exhaustive):

 

Date format

Example date

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 other variations are supported as well.

 

The date format usually does not need to be specified in a header and will be detected automatically. In some cases a large number of quotes may be needed to detect the month/day/year order in the date format unambiguously, especially for intraday files. In that case it may be necessary to use a header that contains the exact date format string. For example:

 

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 date format must stay consistent throughout the quote file. 

 

In case the quote file contains quotes before 1/1/1930, four digits must be used for the year.

 

 

4.2.4 Supported time formats

All common time formats are supported. Some examples of supported time formats (not exhaustive):

 

Time format

Example time

hh:mm

15:45

hh:mm:ss.fff

15:45:23.863

h:mm:ss tt

3:45:23 PM

hhmm

1545

hhmmss

154523

 

Several other formats are supported as well.

 

Hours may be in either 24-hour clock system or 12-hour clock system with AM/PM indication.

Fractional seconds can be specified in up to 3 decimal digits. Either a period, comma or colon may be used as the decimal separator.

 

If necessary the exact time format may be specified in a header.

 

Date and time may also be combined in one column, separated by a space[20].

 

4.2.5 Delimiters

The field (column) delimiter may be a comma, semicolon or tab.

 

4.2.6 Decimal separator

The decimal separator may be either a period or a comma (if not used as the delimiter).

 

4.2.7 Thousand separators

Price and volume values may contain thousand separators in the following ways: If a period is used as the decimal separator, then commas may be used as thousand separators but the value must be enclosed within double quotation marks. If a comma is used as the decimal separator, then periods may be used as thousand separators.

 

4.2.8 Column headers

Column headers may be field names such as Date, Time, Open, High, Low, Close, Volume (or Vol), Bid, Ask. For the date and time columns, also date and time format strings are allowed to specify the exact date/time format. DateTime can be used to indicate that the date and time is combined in one column. Fieldnames are not case-sensitive. Field names may also be included within “<” and “>” or within double quotation marks. Other field names will not be recognized and will cause the data in that column to be ignored.

 

4.2.9 Interpretation of empty fields

Empty rows or rows containing only empty fields (adjacent commas, commas at the start or end of a line or fields containing only white space) will be skipped. Otherwise, empty fields will not be skipped. Empty Date, Time or Close fields will result in an error message. Empty Open fields will result in the Close value being assigned to them. Empty High or Low fields will result in the Open or Close value assigned to them depending on which is higher/lower. Empty Volume fields will result in a 0 volume value. Empty Bid or Ask fields will result in a 0 bid or ask price[21]. (Note that empty fields at the end of a line are usually not visible in Microsoft Excel).

 

4.2.10 Miscellaneous requirements

 


5. Model configuration

 

When creating a new model[22], various model parameters can be configured in the “New Model” dialog box. Most parameters can also be changed during model evolution by selecting “Model parameters…” from the “Edit” menu. Note that while editing parameters during model evolution, the model continues to evolve in the background (if not paused) using the original parameter values. Parameter changes will only become effective after you click “OK” or “Apply”.

 

The various tabs and fields of the “New Model” or “Edit Model Parameters” dialog boxes are discussed in this chapter.

 

5.1 General parameters

 

These parameters can be found on the “General” tab.

 

5.1.1 Quote history file of security

Here the quote file of the security can be selected. This must be a valid quote file as described in 4. Market data. The quote file will be preprocessed to determine the quote interval and Market Trading Hours and to do some other checks. After preprocessing the quote file, the date and time of the first and last quote and the quote interval will be shown.

 

5.1.2 Security name/description

This will automatically be set to the name of the quote file but you can change this to any desired name or description.

 

5.1.3 Model name

After selecting a quote file, the model name is automatically set to the name of the quote file. You can change this to something else. The model name will be used as the default filename when the model is being saved for the first time. After the model has been created, the model name can only be changed using the  “SaveAs…” command from the “File” menu.

 

5.1.4 Model evolution start date and time

The model’s evolution start date and time will automatically be set to the earliest possible start date and time. This is a certain number of bars after the first quote in the quote file. This is because the trading rules need some historical quotes before the model start date. It is possible to set the start date and time to a later date and time. The start date needs to be entered in the format shown to the right of the input field. This is either the US or European date format and depends on the date format setting as selected in the “Options” dialog box.

 

5.1.5 Market Trading Hours

The Market Trading Hours refer to the open and close times of the real world market where the security is being traded. They are used to calculate the amount of daily trading time which is used for accurately compounding return or volatility data series to periods other than the model’s quote interval. Also they are used to calculate the expected date/time of the next quote bar that is being shown (temporarily) in the Current Values window and in charts. Incorrect Market Trading Hours will also cause more notifications in the logger.

 

The Market Trading Hours settings do not affect model evolution nor forecasts and signals. Also they do not affect when new quotes are being processed nor when forecasts and signals are being generated because new quotes are processed as soon as they appear in the quote file which is followed immediately by the generation of a new forecast (and signal if necessary).

 

Note that regardless of the Market Trading Hours settings, all quotes in the quote file will be used. If Pre‑Market or After‑Hours quotes should not be used then they should not be included in the quote file.

 

When a quote file has been selected, the Market Trading Hours are automatically determined using the times of the earliest and latest bars during the first few days of the quote file. You should verify that the Market Trading Hours are correct because it may not always be possible to derive the correct hours from the quote file. Especially the following cases require attention:

·         Intraday quotes from continuous 24h markets (i.e. Forex)
In this case the opening and closing times will both automatically be set to 0:00h. Both times should manually be changed to the market closing time at the end of the week (using the same time zone as the times in the quote file). For continuous markets Adaptive Modeler assumes that the market will open again exactly 48 hours after the closing time on Friday.

·         Non-integer number of quote intervals per day
The number of quote intervals per day is not a whole number (i.e. hours on a market that opens at 9.30h and closes at 16.00h) and in the quote file the last bar of the day has a time later than the market closing time. In that case the closing time should be set to the actual market closing time and not to the time given to the last quote (the quote will still be imported though).

·         Quote intervals smaller than 1 minute
When the quote interval is smaller than 1 minute, the Market Trading Hours may not have been detected correctly and may need to be corrected manually.

·         Variable quote intervals
When a variable interval is used, the Market Trading Hours may not have been detected correctly and may need to be corrected.

 

5.1.5.1 Handling changes in Market Trading Hours

While evolving a model, Adaptive Modeler can automatically check the quote file for changes in the security’s trading hours and adjust the Market Trading Hours. This is useful in case Pre‑Market or After‑Hours trading periods were added during the quote history or when expansions of these periods or of the regular trading hours occurred during the quote history[23]. There are three ways of dealing with adjustments:

  1. automatic checking and adjustment
  2. automatic checking, prompt for adjustment
  3. no automatic checking or adjustment

 

The best way depends on whether changes can correctly be detected automatically (which in turn depends on the regularity of the quote file, missing bars, etc.) and whether or not you want model evolution to be interrupted for manual adjustments. In general it is recommended to check the logger for notifications such as “Missing Quote” or “Quote not within Market Trading Hours” to see if the Market Trading Hours are still correct and have been changed correctly during model evolution. In general, these notifications occur occasionally which is normal but when there are many this may indicate that the Market Trading Hours are incorrect.

 

In any case, you can still change the Market Trading Hours manually using the “Edit Parameters” dialog box. This may be necessary for instance for overriding an automatic change, forcing an undetected change or for reducing Market Trading Hours.

 

Note that historical changes of the Market Trading Hours are being recorded and are used to calculate the number of actual periods (by trading time) between bars for accurate calculation of returns, volatility and other indicators.

 

5.1.6 Pause model after creation

Check this to indicate that the model should be paused immediately after initialization of the agent population. This makes it possible to analyze the initial state of a model before any quotes have been processed.

 

5.2 Agent-based Model parameters

 

These parameters refer to the Agent-based Model and can be found on the “Model” tab.

 

5.2.1 Population Size

The population size is the number of agents in the Agent-based Model. Bigger populations means that more different trading rules are competing and evolving in parallel at the same time. This increases the chance that profitable new trading rules emerge on time when new profit opportunities in the market arise. A bigger population also increases the ability of a model to endure different market regimes since more different strategies can be stored in the agents' trading rules. A larger population size also increases model stability and prevents models from becoming chaotic with extreme forecasts or from reaching a state of imbalance where no agent orders can be matched and no forecasts can be produced. Bigger populations also reduce sensitivity to random numbers so that results of different runs vary less. However, bigger populations require more computations and make model evolution slower.

 

5.2.2 Agent Initialization

By clicking the “Agent Initialization” button, a window will open with settings for the initialization of agent wealth and position (asset allocation). This concerns the start values of wealth and position that are assigned to new agents during model initialization and to new replacement agents that are created during model evolution. Several methods are provided to assign initial wealth and position values to agents which will be described in detail below. Note that the resulting initial distributions can easily be observed by using the Pause model after creation setting and then showing the Wealth Distribution and Position Distribution data series in charts.

 

5.2.2.1 Wealth distribution

In general, it deserves mentioning that the initial wealth that is assigned to an agent has an impact on the amount of influence that it can have on the Virtual Market price. When initial wealth is assigned to agents by any of the random sampling methods described below, this can add noise to the price discovery mechanism. To avoid such noise, assign equal initial wealth to all agents.

 

Initial wealth can be assigned to new agents by any of the following methods:

 

Equal for all agents

All agents get the same initial wealth. The amount can be specified at “Initial wealth”.

 

Pareto distribution

Agent wealth is randomly sampled from a Pareto distribution. The Pareto distribution is a well known power law distribution commonly used to describe wealth or income distributions. In particular it describes an unequal distribution where a large part of total wealth is owned by a small percentage of individuals (also known as the Pareto principle or “80-20 rule”). This distribution is generally considered to apply best to the distribution of wealth among very rich individuals and not necessarily to the rest of the population. A Pareto distribution has two parameters: the “Minimum wealth” and the “Pareto index”. The minimum wealth must be greater than zero. The Pareto index is a value greater than zero (usually between 1 and 3) that indicates the unevenness in income distribution. The higher the Pareto index, the more even the distribution is.

 

Maxwell-Boltzmann distribution

Agent wealth is randomly sampled from a Maxwell-Boltzmann distribution. This is an exponential distribution originating from the field of statistical mechanics for describing the distribution of energy of atoms in a gas. In econophysics, its general significance has been recognized for describing the distribution of a conserved quantity (such as money) among elements of a closed system (such as agents in an economy)[24] [25].

Note that although money may be considered conserved in a closed economy, wealth (when it includes non-cash assets) is not necessarily conserved. Wealth may change due to changes in asset prices or through the creation and destruction of assets[26]. Furthermore, a model in Adaptive Modeler is in most cases not a strictly “closed economy” (see here). However, for the purpose of assigning initial wealth values to agents, these inconsistencies are relatively minor, especially when the initial position (asset allocation) of agents is set to 0%.

The Maxwell-Boltzmann distribution has a parameter a which influences the magnitude of values (more precisely: a = rms2 / 3, with rms being the root mean square of the values).

 

5.2.2.2 Position distribution

In general, it should be noted that the initial position that is assigned to agents has a big impact on the total (net) number of shares that exist in the model and could therefore cause a bias or unbalance in the model, especially when it is strongly positive or negative. This could result in unstable models or lack of trading. To prevent this bias or unbalance, set the (average) initial position value to 0%. (Note however that the total number of shares that exist in the model also varies during model evolution because of agent replacement).

 

Furthermore, an agent’s initial position will usually be changed immediately after its creation as a consequence of trading according to its trading rule. The position distribution may therefore diverge from the chosen initial distribution during model evolution.

 

Initial positions can be assigned to new agents by any of the following methods:

 

Equal for all agents

All agents get the same initial position. The position can be specified at “Initial position” and must be within [-100%, 100%].

 


Gaussian distribution

Agent position is randomly sampled from a Gaussian (Normal) distribution with the specified mean and standard deviation. The mean must be within [-100%, 100%]. After random sampling, any position value less than -100% will be set to -100% and any value greater than 100% will be set to 100%.

 

5.2.3 Minimum position unit

This is the minimum unit (stepsize) of advised positions (as % of wealth). This value is returned by the LevUnit gene. It can not be changed during model evolution. It is also used for checking whether an agent order would be of sufficient size to be actually placed (see Order generation).

 

5.2.4 Broker commission (for agents)

These are the virtual costs per buy or sell transaction charged to agents for trading on the Virtual Market. By default the values for Broker Commission of the Trading System are used here but other values can also be provided. A fixed fee (amount) can be specified and/or a variable fee (percentage of transaction value).

 

5.2.5 Forecast

Here you can specify whether the forecast should be based on the Virtual Market Price (which is the clearing price on the Virtual Market based on the orders of all agents) or on the Best Agents Price (which is a price calculated using only the orders of a group of best performing agents). The size of the Best Agents group can be specified as a percentage of the total population size.

 

Note that the Best Agents Price is always calculated and available for inspection using the Best Agents Price data series, also when it is not being used as the forecast. This is for instance useful for comparing it with the Virtual Market Price or for comparing its forecast accuracy with the Virtual Market Price forecast accuracy using any of the data series that has a source parameter. The Best Agents group size can therefore always be specified.

 

5.2.6 Rounding

 

Number of decimal places to round quotes on importing

Quotes will be rounded (on importing) to the number of decimal digits specified. After selecting a quote file in the “New Model” dialog box, Adaptive Modeler will attempt to automatically detect the number of decimal digits that are used in the quote file and set the rounding parameter. You should check this value and adjust it if necessary.

 

Minimum price increment for price generated by model

All prices generated by the Agent-based Model (including bid, ask prices, trades and forecasts) will be rounded to the nearest rounding unit as specified by this parameter. After selecting a quote file in the “New Model” dialog box, the minimum price increment will automatically be set to 10-n where n is the number of automatically detected decimal digits. For example, if 2 decimal digits were detected in the quote file, then the minimum price increment will automatically be set to 0.01. You should check if this value is desired and adjust it if necessary. In general, the minimum price increment should be equal to the smallest pricing unit of the security on the real world market. For example, if the actual minimum pricing unit on the real world market is 0.05 then the minimum price increment could manually be changed to 0.05.

 

5.2.7 Random seed

As the use of random numbers is inherent to agent-based modeling and genetic programming, Adaptive Modeler uses a pseudo random number generator. Random number are used for instance for the initial creation of trading rules (genomes) and for the crossover and mutation operators of the breeding process. The random number generator uses a Mersenne Twister algorithm[27] to produce random number sequences that meet standards that are generally accepted by scientific researchers.

 

The random seed indicates the starting point in the random number sequence to be used and thereby affects the entire sequence of random numbers that will be generated during a model’s evolution. Therefore, to recreate a particular model exactly, the same random seed value is required as was used in the original model[28].

 

You can specify that the random seed is to be generated from the computer’s internal clock or you can enter a specific seed manually (i.e. to recreate an earlier created model). To enter a seed manually, first uncheck “Generate seed from clock”, then enter the desired seed value at “Seed”.

 

After a model has been initialized, the random seed value that was used for the model is shown in the “Seed” text box for future reference (also when the seed was generated from the clock).

 

Note that when a model is saved, the current position in the random sequence is also saved with the model (not visible to the user) so that after re-opening a model, the random number generator continues from that same position. This means that saving and opening a model does not have any effect on the random number sequence and thus neither on model evolution.

 

Note that some features of Adaptive Modeler that also use random numbers (such as the Statistical Simulation data series and the Genome Creation and Mutation Tester) use their own separate Mersenne Twister random number generators. This is to ensure that using these features does not in any way interfere with the random number sequence used for evolving the agent-based model. (The seed value of these random number generators is generated from the clock and can not be observed or set by the user).

 

5.3 Genome parameters

 

The “Genomes” tab contains parameters for controlling the construction of trading rules (genomes). Optimal values for these parameters depend on various factors and may require experimentation. An understanding of how Adaptive Modeler uses genetic programming to construct trading rules is recommended. More information about this is given in III. Genetic programming in Adaptive Modeler.

 

5.3.1 Maximum genome size

The maximum genome size is the maximum number of nodes (genes) a genome is allowed to have.

 

5.3.2 Maximum genome depth

The maximum genome depth is the maximum number of hierarchical levels a genome is allowed to have.

 

5.3.3 Minimum initial genome depth

This is the minimum number of hierarchical levels for new genomes that are created during model initialization. It also applies to the minimum number of levels for subtrees that are created by the mutation operator to be inserted into existing genomes during breeding.

 

5.3.4 Maximum initial genome depth

This is the maximum number of hierarchical levels for new genomes that are created during model initialization. It also applies to the maximum number of levels for subtrees that are created by the mutation operator to be inserted into existing genomes during breeding. Note that increasing this value can slow down model creation and evolution significantly. If genomes with a high number of levels are desired it is recommended to consider increasing Maximum Genome Depth instead. This will gradually increase the genome depth by crossover and mutation without slowing down model creation and evolution as much.

 

5.3.5 Genome creation gene selection

The genes (functions and terminals) to be used in creating genomes for the initial trading rules and for the mutation operator can be selected by the user. By clicking on the “Select genes…” button, a window will open showing a table of all the genes. In this table the genes to use can be selected or deselected. More information about the genes is given in Function and Terminal set (pressing F1 while the cursor is in a cell with a gene or type will show context-sensitive help).

 

The gene selection can be changed before the creation of a new model and also during model evolution. When the gene selection is changed during model evolution, already existing genomes will not be affected and will still contain genes of the old selection. Changing the gene selection during model evolution only affects the new genome parts that are created by the mutation operator and inserted into new offspring genomes. Over time, the presence of genes in the total genome population will shift towards the new selection through the effects of mutations and replacements. Note that changing the gene selection has no effect on the crossover operation.

 

Selecting and deselecting genes should be done with care. Not every selection of genes will result in successful genome creation and mutation. In fact, for many selections, genome creation and/or mutation may be slow or not even possible at all. This is because some genes are required for creating acceptable genomes. Which genes are required depends on what other genes are already selected and also on the minimum/maximum initial genome depth parameter values.

 

When you have made a gene selection and click “OK”, a quick check will be performed to see if a genome can be created with this selection fast enough. If not, a warning will be shown. However, this is only a quick check. It does not check how many (unique) genomes can be created per second and it does not check whether genomes can be mutated easily or not. Therefore, a better way of testing the gene selection is provided by the “Genome Creation and Mutation Tester”.

 

5.3.5.1 Genome Creation and Mutation Tester

The Genome Creation and Mutation Tester allows testing a gene selection in a safe test environment, isolated from any running model. It is located in the “Select Genes” window below the genes table. By clicking “Start” the tester will start creating genomes using the genes selected in the table and according to the Genome Size and Depth parameter values that are currently entered on the “Genome” tab[29]. The table shows how many genomes could be created in total and per second, divided into “unique valid” genomes, “duplicate” genomes and “invalid” genomes. Invalid genomes are failed genome creations that did not meet maximum genome size or depth or other criteria. Duplicate genomes are identical to already created genomes (non-unique) and would only be useful when the “Create unique genomes” setting is not checked. The remaining genomes are valid and unique and those are the ones needed when “Create unique genomes” is checked. (The tester does not care whether or not “Create unique genomes” is checked. The user should decide which values from the test results matter). The tester also mutates all the created unique valid genomes once to test whether mutation is possible and occurring fast enough. Note that in some cases genome creation may go very well but mutation may go very slow or vice versa. The tester can be stopped by clicking the “Stop” button. Clicking the “Start” button again will erase the previous test result and restart the tester.

 

The tester does not provide any conclusions on whether a gene selection is good or not. It simply shows how many (unique) genomes could be created and mutated and how fast. It is up to the user to decide if this is fast enough. Note that the numbers of genomes created and mutated per second reported by the tester depend on the available resources on the computer and whether or not a model is evolving in the meantime. They may be different than the number of genomes created and mutated per second in actual model creation and evolution. The numbers are only meant to compare the speed of genome creation and mutation for different genome settings and gene selections.

 

Note that the Genome Creation and Mutation Tester (nor the quick check performed when clicking “OK”) does not in any way affect an already running model nor its evolution (even a separate pseudo random number generator is being used). A new gene selection will only become effective after clicking “Create Model”, “OK” or “Apply” on the “New/Edit Model” dialog box. If model evolution becomes very slow or freezes after accepting a new gene selection, the gene selection can be changed again.

 

5.3.6 Create unique genomes

When this option is enabled, all genomes created during model initialization will be unique. Enforcing uniqueness increases the genetic diversity of the population which is generally considered to have a beneficial effect on evolution. Enforcing uniqueness may slow down model initialization for gene selections for which it is not (easily) possible to create the required number of unique genomes. In case model initialization becomes too slow or seems to stop, you can cancel model initialization by clicking on the “Cancel” button of the “Creating agent population” window and create a new model with other settings.

 

During model evolution, uniqueness of new genomes that are created for new offspring agents by the breeding process will also be checked (if this option is enabled) but only against the agents in the Parent selection and the other offspring agents that are being created during that breeding cycle.

 

When this option is disabled, no uniqueness is enforced and duplicate genomes may occur in the population.

 


5.4 Evolution parameters

 

These parameters affect the breeding process that takes care of selecting parent agents and creating new agents through crossover and mutation. Optimal values for the Evolution parameters depend on various factors and require experimentation. More information about the breeding process is given in 3.1.1 Agent Population.

 

5.4.1 Breeding cycle frequency

This is the number of bars between breeding cycles. For example, if the breeding cycle frequency is 10, breeding will only occur once every 10 bars. Note that in genetic programming terms, it might be appropriate to call a breeding cycle a “generation” if the number of agents being replaced every breeding cycle is a significant part of the population and the breeding cycle frequency is a sufficient number of bars to justify such big replacements. On the other hand, replacing only a few agents frequently (i.e. every bar) rather approaches “steady-state” evolution.

 

5.4.2 Initial selection

Every breeding cycle starts with an initial selection. The initial selection is a temporary sub population. Breeding and replacement takes place only within this sub population. The initial selection is made by randomly selecting agents whose age is equal to or higher than the minimum breeding age. This is to ensure that the comparison of agent performance is supported by a sufficient number of bars. The size of the initial selection can be specified as a percentage of the total number of agents of minimum breeding age and older. For instance, when the Population Size is 2000 and there are 500 agents of minimum breeding age and the Initial selection is set at 50% then the Initial selection will contain 250 agents.

 

Note that the number of agents of minimum breeding age and older (and thus the number of agents in the initial selection) may be unstable, especially during the early stages of model evolution. This is caused by the feed-back effect of agent replacement on agent age. This effect can best be observed by showing the Creations (or Terminations) data series in a chart.

 

5.4.3 Minimum breeding age

This is the minimum age required for agents to qualify for potential participation in the Initial selection. The age of an agent is the number of bars that have been processed since the agent was created. The minimum breeding age also specifies the period over which agent performance will be compared. For instance, if the Minimum breeding age is 100, then the agents’ performance over the last 100 bars will be compared. Note that the maximum comparison period size is 250 bars. This does not mean that the Minimum breeding age can not be set higher than 250, but the period for performance comparison is maximized to 250 bars.

 

This parameter balances the adaptability versus the reliability of the model. With low minimum breeding age, new successful agents can take part in breeding relatively early, allowing them to generate more potentially successful agents. This increases their influence on the forecast and accelerates adaptation of the population. However, since agent performance is only measured over a short period, random factors may have a significant distorting effect. With higher minimum breeding age values, the performance is compared over a longer (more significant) period of time making the selection of agents for breeding more reliable.

 

5.4.4 Parent selection

The parent selection will contain the best performing agents (of the initial selection) that will act as parents in crossover operations for creating new agents. The performance criteria for selection is the agent’s Breeding fitness return. Because the parent selection is a sub group of the initial selection, its size can be specified as a percentage of the initial selection. Note that normally every pair of parents will create 2 offspring agents, making the number of offspring equal to the number of parents. The new agents will replace the worst performing agents of the initial selection (judged by the Replacement fitness return). This mechanism keeps the population size constant. For instance, if the initial selection contains 200 agents and parent selection is set at 10%, then 20 new agents will be bred (from the 20 best performing agents of the initial selection) and replace the 20 worst performing agents of the initial selection.

 

5.4.5 Mutation probability

A new agent will be mutated with this probability (right after its creation by the crossover operation). Note that the actual percentage of new agents being mutated may be different than the given probability. This is because the mutation operator may not always succeed in performing an acceptable mutation within a time limit.

 

  

5.5 Trading System parameters

 

The “Trading System” tab contains parameters related to the Trading System.

 

5.5.1 Allow Short Positions

If this option is checked the Trading System will go short when the forecast is lower than the last available quote (for 100% of total capital, after closing any long position). If unchecked, the Trading System will hold only cash when the forecast is lower than the last available quote (after closing any long position).

 

5.5.2 Significant Forecast Range

If the absolute forecasted price change is within the specified range, the forecast is considered significant. This means that the Trading Signal Generator can generate a Long or Short signal based on this forecast. Also, this range is relevant for the Forecast Directional Accuracy, Forecast Directional Significance, Forecast Directional AUC, Filtered Volatility and the Statistical Simulations data series.

 

The upper limit is useful to prevent the generation of Trading Signals when the forecasts differ too much from the security’s price (i.e. when the forecasts go to extreme values or remain fixed for a period of time). In general, it is desirable that forecasts do not differ more than at most a few standard deviations of return per bar from the security’s price, since bigger price movements are very rare in reality. Therefore setting the upper limit to i.e. 10% (for daily prices) will filter out a lot of unwanted model behavior while hardly affecting useful model behavior.

 

The lower limit is useful to prevent the generation of trading signals when price changes are being forecasted that may be too small or insignificant to act upon. Note that when the lower limit is set to 0%, a forecast will still be declared insignificant when the forecasted price change is 0%. (In other words, a forecast is always declared insignificant when the forecasted price change is 0%).

 

5.5.3 Generate Cash Signal when forecast is outside range

This is to specify that any existing long or short position should be closed when the absolute forecasted price change is outside the Significant Forecast Range (or 0%).

 

5.5.4 Apply FDA Filter

When “Apply FDA filter” is enabled, Trading Signals will only be generated when the Forecast Directional Accuracy (as calculated according to the specified “FDA Settings”) is higher than or equal to the specified “Threshold”. The Forecast Directional Accuracy is an indicator measuring the percentage of bars for which the direction of price change was forecasted correctly. See Forecast Directional Accuracy for more information on this indicator and its parameters.

 

5.5.5 Start Capital

This is the initial capital (in cash) of the Trading Simulator at model start.

 

5.5.6 Enable Trading Simulator

With this switch you can enable or disable the Trading Simulator (before or during model evolution). When this switch is checked at model start, the Trading Simulator will trade from the start of model evolution. If this switch is not checked at model start, you can specify that the Trading Simulator should start at a later time using “Auto start at bar”.

 

This switch can also be changed during model evolution to temporarily suspend or resume trading. Note that when trading gets disabled during model evolution, any open position will be closed first.

 

5.5.7 Auto start at bar

When this is checked, the Trading Simulator will automatically get enabled at the specified bar number. Once the model is evolving, you can still enable or disable the Trading Simulator manually (before or after auto start) using the “Enable Trading Simulator” checkbox.

 

5.5.8 Fixed Broker Fee

This is the fixed broker fee (amount) per buy or sell transaction that will be applied by the Trading Simulator and the Statistical Simulations. Note that switching from a short to a long position or vice versa will be counted as two transactions and the fixed broker fee will thus be charged twice.

 

5.5.9 Variable Broker Fee

This is the variable broker fee (percentage of transaction value) per buy or sell transaction that will be applied by the Trading Simulator and the Statistical Simulations.

 

5.5.10 Average bid/ask spread

This is the average (expected) difference between the bid and ask price of the security on the Real Market, expressed as a percentage of the price. It is used by the Trading Simulator and the Statistical Simulation data series to calculate the price at which orders can be executed. Note that Bid/Ask market data from the quote file is not used by the Trading Simulator or the Statistical Simulation data series.

 

5.5.11 Average slippage or price improvement

Slippage is the difference between the market’s bid or ask price at order placement and the actual price of order execution. This difference is caused by delays (and for high volume orders, the order’s adverse influence on the price until the order has been filled entirely). Slippage is expressed as a percentage of the price and can be positive or negative. Negative slippage is also called “price improvement” because the order could be executed at a better price than the bid or ask price. In Adaptive Modeler, the slippage parameter indicates the average expected slippage and is used by the Trading Simulator and the Statistical Simulation data series to calculate the expected price at which orders are executed.

 

5.6 Saving and restoring model configurations

 

Model configurations can be saved to disk separately so that they can easily be reused for creating new models. A saved model configuration is a set of model parameter values and may include a quote file name, model start date, trading system preferences and other model parameters.

 

Model configurations can be saved with or without a quote file name. A configuration with a quote file name can thus be used to create a model for a particular security. A configuration without a quote file name can be used as a template for a class of securities that share certain parameter values.

 

When a model configuration that includes a quote file name is opened, the quote file will be pre-processed in the same way as when a quote file is selected manually. Recall that normally, certain settings (i.e. model name, security name, model start date, Market Trading Hours and rounding settings) are automatically determined after a quote file has been selected. However, when opening a model configuration that includes a quote file name, these settings will be restored from the configuration file. Only if one of these setting in the configuration file is empty or invalid for the selected quote file, it will automatically be re-determined based on the quote file.

 

Model configurations can be saved and opened while creating a new model using the “New Model” dialog box. When editing model parameters during model evolution, model configurations can only be saved.

 

5.6.1 Default configuration

Whenever the “New Model” dialog box is opened, first the default parameter values are being retrieved from the default configuration. After installing Adaptive Modeler, the default configuration is set to an included “Standard” configuration file. The default configuration can be changed to any other preferred (user created) model configuration file by choosing “Options…” from the “Tools” menu.


6. User Interface

 

6.1 Controlling model evolution

Model evolution can be paused and resumed with the “pause” and “resume” buttons in the toolbar or by pressing F3. When the model is paused, this is always right after a new forecast (and trading signal if any) has been generated and before importing the next quote. Model evolution can also be advanced manually bar by bar with the “step” button or F4 key. The step function can only be used after the model has been paused first.

 

6.2 Data series tree view

The evolution of a model can be followed by monitoring one or more of the various data series included in Adaptive Modeler. A data series is any kind of data that the system updates during model evolution such as price data, forecasts, model characteristics, returns, etc. All the available data series are contained in the data series tree view. On the top level there are three main categories:

 

By hovering over the data series names with the mouse, short descriptions will appear. By pressing Shift-F1 when a data series (not an expandable category) is selected, the documentation for the data series is shown in the Help window.

 

Some naming conventions:

 

Any data series can be shown in a chart simply by double clicking its name in the tree view (or by pressing Enter). Alternatively, a data series can be added to an existing chart by dragging and dropping it onto the desired chart. Data series can also be added to the Current Values window by dragging and dropping.

 

There are two kinds of data series:

 

Time series return historical values such as price, returns, Trading Simulator wealth, etc. Most data series are time series. When shown in a chart, a time series usually is shown as a line chart although other chart types also occur.

 

Distribution series return current statistics and distribution data of a population of values such as agent wealth distribution, agent age distribution, historical simulation return distributions, etc. When shown in a chart, a distribution series is shown as a histogram showing the distribution of values. Note that only the current values of a distribution series can be shown, not the historical values. A distribution series can usually be recognized by the word “distribution” in its name.

 

For some advanced issues about data series see 8. More about data series. A full description of all available data series is given in I. Data series reference.

 

6.3 Charts

Charts windows can contain several charts and provide automatic arrangement. The Charts window itself is a multiple-instance window type, meaning that multiple charts windows (each containing one or more charts) can exist simultaneously. Charts windows can be created through the View menu (see 6.11.7 Creating window instances).

 

6.3.1 Adding charts

A data series can be shown in a chart by double clicking the data series name in the data series tree view (or by pressing ENTER on a data series name). A data series can also be dragged from the tree view to the title bar of the Charts window where the new chart is to be created (i.e. when multiple Charts windows are visible).

 

6.3.2 Adding data series to an existing chart

A time data series can be added to an existing chart by dragging and dropping its name from the data series tree view onto the desired chart. Charts can contain up to eight time data series. Distribution data series can not co-exist with any other data series in one chart.

 

6.3.3 Removing charts

Click the exit button in the top-right corner of the chart or use the right mouse button on a chart to show the context menu and select “Remove Chart”.

 

6.3.4 Removing data series from a chart

Use the right mouse button on a chart to show the context menu. Select the desired data series and select “Remove”.

 

6.3.5 Scrolling through charts

Charts that contain time series can be scrolled horizontally to see the history of the model. To scroll a chart, simply drag the chart surface to the right to move back in time or to the left to move forward in time (position the mouse on the chart’s plot area, hold down the left mouse button and move the mouse to the right or left).

 

Normally, charts are automatically updated (moved) during model evolution and always show the most recent bar. When a chart is scrolled back by the user, the visible chart is no longer being updated by the model to allow undisrupted viewing (although the model may still be evolving). To get the chart moving again, simply drag the chart to the left until the most recent bar becomes visible (you can also use the small right arrow button as explained below). As soon as the most recent bar is visible again, the chart will be updated and moved automatically again with model evolution.

 

When a chart is scrolled back, two small arrow buttons will appear near the upper-right corner of the chart (below the maximize and close buttons). These buttons can be used to instantly jump to the start[30] or the end of model history. Note that these buttons are not shown when the chart is showing the most recent bar.

 

When charts are linked, scrolling a chart will cause all the other charts in the same Charts window to scroll synchronously so that they all show the same period. When charts are not linked, every chart can be scrolled independently.

 

6.3.6 Maximizing a chart

A chart can be maximized (inside the Charts window) by clicking on the maximize button in the top-right corner of the chart. This will make any other charts within the same Charts window invisible until the maximized chart is de-maximized again by clicking on the de-maximize button.

 

6.3.7 Data series names

The names of the data series are shown at the top of the chart in the corresponding color. The order of the data series in the chart’s context menu (from top to bottom) corresponds with the order of the data series names at the top of the chart (from left to right).

 

In the “Options” dialog box (from the “Tools” menu) you can choose whether full paths should be included in the data series names. The path indicates the location of the data series in the data series tree view. This can be useful sometimes to better clarify what data series are included in the charts. Note that in small charts there may not always be enough space to display the full names completely.

 

Note that the names of most Trading System data series are preceded with “TS” to distinguish them from comparable data series in the Security and Agent-based Model categories. Virtual Market related data series names start with “VM” to distinguish them from comparable data series in the Security and Trading System categories. Names of Agent data series (providing information of an individual agent) are preceded with “Agent” to distinguish them from comparable Population data series.

 

6.3.8 Adding a moving average

Use the right mouse button on a chart to show the context menu. Select the desired data series and select “Add moving average…”. If “Add moving average…” can not be selected then this data series can not have a moving average. For more information on adding moving averages see 8.2 Moving Averages.

 

6.3.9 Adding an autocorrelation indicator

Use the right mouse button on a chart to show the context menu. Select the desired data series and select “Add autocorrelation…”. If “Add autocorrelation…” can not be selected then this data series can not have an autocorrelation indicator. For more information on adding autocorrelation indicators see 8.3 Autocorrelation.

 

6.3.10 Changing parameters

Use the right mouse button on a chart to show the context menu. Select the desired data series and select “Parameters…”. For more information on modifying the parameters of data series see 8.1 Parameters.

 

6.3.11 Showing the data overlay

Clicking on a data series name at the top of a chart will show a data overlay for that data series. Clicking once more on the same name will hide the data overlay. Double-clicking anywhere on the chart’s plot area will show or hide the data overlay for the first data series in the chart. The data overlay can also be shown or hidden through the chart’s context menu. Right click on the chart to open the context menu, select the desired data series and select “Show data overlay”. The data overlay is shown in the same color as the data series.

 

The data overlay always includes the bar number and the date and time of the shown bar. For time series also the current value, previous value and the percentage change since the previous value are shown. For distribution series the number of values[31], mean, standard deviation, median, minimum and maximum value are shown. For some data series some additional information is shown as well.

 

While the model is evolving (and the chart is not scrolled away from the most recent bar) the data overlay always shows the data of the most recent bar. When the model is paused, waiting for a new quote or when the chart is scrolled away from the most recent bar, values of historical bars can be shown (for time series) by holding down the SHIFT key while moving the mouse to the desired bar[32]. When an historical value is shown in the data overlay, a crosshair is shown to indicate the value in the chart. For distribution series, when the data overlay is shown, bin details can be shown by holding down the SHIFT key while moving the mouse across bins.

 

When a model is paused, waiting for a new quote or when the chart is scrolled away from the most recent bar, the data overlay for the first data series can also be shown immediately by holding down SHIFT while moving the mouse over the chart.

 

When charts are linked, moving the crosshair (by holding down SHIFT while moving the mouse) will cause any crosshairs in other charts (in the same Charts window) to move synchronously so that the data overlays all show the same bar. This makes it easy to instantly see the values of several data series at the same bar.

 

The reason for showing the bar number, date and time for each data series in the data overlay is that not all data series are updated at the same time during the Agent-based Model cycle. Also not all data series show the same date and time for a given bar number. (Most data series return the date and time of the close of the bar. If a data series returns another date and time then this is explained in I. Data series reference).

 

6.3.12 Linking charts

When the “link charts” button in the toolbar is enabled, all the charts in the same Charts window are “linked”. This means that during manual scrolling (dragging) of a chart to see historical values, all the other charts in the same Charts window will scroll synchronously to show the same period. Also all visible data overlays and crosshairs will show the values of the same bar. When linking is disabled, all charts can be controlled individually.

 

6.3.13 X-axis for time series charts

6.3.13.1 Chart period

The chart period is the period of time shown in time series charts and can be changed by selecting the desired “Chart period” in the toolbar. All time series charts use the same chart period and show the same range of values on the X-axis. (When a variable quote interval is used, the periods effectively shown in charts may not be exactly as long as the selected “Chart period”).

 

The number of data points plotted in a chart does not depend on the chart’s width. When resizing the application window or when adding or removing charts, the charts continue to show the same information. However, for some data series the chart width may affect the way the values are plotted depending on the available space per bar. For instance, when a chart is too small, open‑high-low-close bars will not be drawn.

 

For long chart periods (spanning several thousands of bars) some data series (i.e. Signal and Right/Wrong Forecasted Price Changes) may not be drawn because of insufficient space to render their values clearly. In this case the name of the data series above the chart will be shown in gray.

 

6.3.13.2 Positioning and meaning of X-Gridlines

The X‑Gridlines are always drawn at the start of a period (i.e. day, week, month) except when there is no bar at the start of the period (i.e. in case of a missing quote). In that case the gridline will be drawn at the first available bar of the period. When many quotes are missing (i.e. during Pre‑Market or After‑Hours) this is visualized clearly by the gridlines as they get closer to each other. Note that a gridline will only be drawn if it is at least 2 bars separated from the previous gridline.

6.3.13.3 X-axis labels

The X-axis labels are drawn at the gridlines when there is enough space. The X-axis labels can have the following formats depending on the chart period shown and the size of the chart:

 

X-Gridline label Format

Example (7/30/2004 10:21:42.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

 

Note: the table above shows the US date formats (mm/dd/yy). This is the default setting. The date format can be changed to European (dd/mm/yy) in the “Options” dialog box (from the “Tools” menu).

 

When a chart is scrolled back, the labels will use other formats with more complete date and time information so that it is easier to see what period is being shown in the chart.

 

6.3.14 X-axis for distribution series charts

6.3.14.1 Histogram bin size

The histogram bin size is automatically determined based on the values to show[33].

6.3.14.2 Bin range shown

By default, the range of values shown on the X-axis is 10 standard deviations wide and runs from [μ-5σ, μ+5σ] where μ is the mean. For data series whose values can not be negative, the range starts from 0 or μ-5σ whichever is greater and ends 10σ further. Note that the first bin also contains all the values that are lower than its lower bound and the last bin also contains all the values that are higher than its upper bound.

6.3.14.3 Positioning and meaning of X-gridlines and labels

The X-gridlines are always shown at μ and at standard deviation intervals from μ. The μ gridline’s label is shown in the data series color. For example, the gridline directly to the left of the μ gridline indicates μ-σ and the gridline directly to the right of the μ gridline indicates μ+σ. Note that the X-gridlines are drawn at their exact location and do not necessarily coincide with bin edges. So if for instance the μ gridline is drawn halfway a bin then some of the values in that bin may be smaller than μ while others may be higher than μ. The X-axis labels are shown at those X-gridlines where there is enough space to show their label.

 

6.3.15 Y-axis

6.3.15.1 Y-axis scaling

Chart scaling for time series is automatically set to linear or logarithmic depending on the data series in the chart and their value ranges to be shown. Logarithmic scaling will be used for data series whose values are related to prices, wealth or returns and for the mean forecast error data series.

6.3.15.2 Y-axis labels

The Y-axis labels use scientific notation for very high or low numbers. So 1.00E+06 is 1 million, 2.50E+07 is 25 million, 5.32E-05 is 0.0000532, etc. Note that when logarithmic scaling is used, Y-axis labels are only shown at those Y-gridlines where there is enough space to show their label.

 

6.4 Current Values

The Current Values window shows the current (or latest) values of data series. Data series can be added to the Current Values window by dragging and dropping them from the data series tree view. For distribution series the mean value will be shown.

 

By clicking the right mouse button on a data series row in the data grid, the context menu of the data series appears containing options to change its parameters, to add a moving average or an autocorrelation indicator or to remove the data series from the Current Values window. For more information about these options see 8.1 Parameters, 8.2 Moving Averages or 8.3 Autocorrelation.

 

In the “Options” dialog box (from the “Tools” menu) you can choose whether full paths should be included in the data series names. The path indicates the location of the data series in the data series tree view.

 

6.5 Trading Signals

 

The Trading Signals panel shows the last 100 trading signals that were generated. With every signal, the closing date, time and price of the last quote bar on which the signal was based are shown. For more information on how Trading Signals are generated see 3.2.1. Trading Signal Generator.

 

The trading signals can also be visualized in a chart by using the Signals data series. Also they can be followed by adding this data series to the Current Values window.

 

 

6.6 Population Window

The Population window offers several ways to visualize the dynamics of the agent population. Basically, the Population window shows scatter plots of one agent property against another (i.e. agent wealth against agent age). This can help identifying relationships between different properties which may provide insight into the particular dynamics of a model. The properties that can be plotted are the Agent data series (in the Agent category of the data series tree view) as well as some other values such as age and genome size. It is recommended to read the documentation of Agent data series to better understand the possibilities of using these data series in the population window.

 

The Population window is a multiple-instance window type meaning that multiple Population windows can exist simultaneously. This may be useful for monitoring different sets of agent properties simultaneously without having to switch between properties all the time. Population windows can be created through the View menu (see 6.11.7 Creating window instances).

 

6.6.1 Scatter plots

By selecting the desired agent properties from the “X” and “Y” drop-down lists, all agents will be plotted using the X property for the horizontal position (along the X-axis) and the Y property for the vertical position (along the Y-axis). (Agents whose X-property or Y-property have no value will not be plotted). By default the X-axis and Y-axis scaling is done in the same way as the distribution charts X-axis. It is possible to select other axis ranges and gridline intervals for both axes (see 6.6.4 and 6.6.5).

 

6.6.2 Density charts

As an alternative to a scatter plot, a density chart can be shown by clicking on the “Density chart” button. A density chart doesn’t plot individual agents but shows the number of agents per area by color intensity. A density chart can therefore be seen as a 2-dimensional distribution chart where the color intensity indicates the frequency. The area unit dimensions are one X-bin by one Y-bin (see Histogram bin size). A legend showing the frequency values for the different color intensities is shown at the top of the chart. A density chart can be useful when many agents are close together in a scatter plot and overlap each other which would make it difficult to see how many agents are in a given area.

 

6.6.3 Using the Z (color) dimension

In a scatter plot it is possible to show a third agent property by color (intensity). By selecting the desired agent property from the “Z (color)” drop-down list, the agents will be plotted using this property to set their color (intensity). Higher color intensities indicate higher values. A legend with the property values for the different color intensities is shown at the top of the chart. Note that properties whose values can be positive and negative will use blue for positive values, red for negative values and white[34] for zero values. Properties whose values can only be positive or zero will only use intensities of yellow[35]. Agents whose Z-property has no value will be plotted in green, indicating “not available” (N/A).

 

6.6.4 Changing the axes ranges

By default the X-axis and Y-axis range is 10 standard deviation intervals (see 6.3.14.2). By clicking on the “X-axis settings” button (or “Y-axis settings” button), the X-axis (or Y-axis) toolbar will appear. On this toolbar the range of values to be shown on the axis can be set. There are three range modes:

  1. Auto: automatically sets the range from the minimum to the maximum value that occur in the agent population.
  2. Stdev intervals: sets the range to the user specified number of standard deviation intervals, centered around the mean.
  3. Fixed range: sets the range to the user specified values, allowing “zooming in” on any area.

 

Note that agents whose property values are outside the shown range are plotted on the edge of the chart to indicate that there are agents outside the shown range.

 

6.6.5 Changing the gridline intervals

By default, the X- and Y-gridlines are shown at the mean and at standard deviation intervals from the mean (like the X-gridlines in distribution charts, see 6.3.14.3). Using the X-axis (or Y-axis) toolbar, any of the following gridline modes can be chosen:

  1. Round numbers: gridlines are drawn at round numbers
  2. Stdev intervals: gridlines are drawn at the mean and at standard deviation intervals from the mean (the default mode)
  3. Bin edges: gridlines coincide with bin edges (they are not necessarily drawn at every bin edge)

 

6.6.6 Showing the data overlay

By clicking on the “Show Data Overlay” button, data overlay windows are shown for each of the selected properties (X, Y and Z) containing the number of values31, mean, standard deviation, median, minimum and maximum values. Clicking once more on the button will hide the data overlays.

 

6.6.7 Showing correlation and regression

Clicking on the “Show Correlation and Regression” button will show an overlay window containing the correlation (r) and r-squared (r2) values of the correlation between X and Y. Also the regression line formula is shown and the line itself is drawn. The correlation value r is the Pearson product-moment correlation coefficient and can range from +1 for perfect positive correlation to -1 for perfect negative correlation. A value of 0 indicates no correlation at all. The value r2 (also known as the coefficient of determination) is the square of the correlation coefficient r and ranges from 1 for perfect (positive or negative) correlation to 0 for no correlation at all. While r indicates the direction of the correlation (positive or negative), r2 indicates the strength of the correlation.

 

6.6.8 Setting the agent dot size

Using the “Agent dot size” button, the size of the agent dots as they are plotted on a scatter chart can be set. Larger dots are more clearly visible but may overlap each other and hide information. Smaller dots have less overlap and thus show more information but may be less clearly visible.

 

 

6.7 Performance Overview

The Performance Overview shows the performance of the Trading Simulator and can be shown by selecting “Performance” in the “View” menu. The Performance Overview contains various indicators of returns, risks and sub period statistics. Note that the performance calculations of the Trading Simulator take into account all transaction costs (i.e. the broker commissions, spread and slippage as specified in the Trading System Parameters).

 

6.7.1 Settings

Performance is calculated according to the Performance Calculation Settings that are shown in the top-left. They can be changed by clicking on the “Settings” button above the Performance Overview. The settings are discussed in detail below.

 

6.7.1.1 Calculation Period

The period over which performance should be calculated can be specified in the same way as for data series with a calculation period parameter. All information shown on the Performance Overview is always based on the specified calculation period.

 

If the Trading Simulator has not started yet or if the calculation period starts before Trading Simulator start, no performance information is shown. Also, if the calculation period starts or ends after the current model bar, no performance information is shown. In these situations, the Performance Overview shows “Insufficient data”.

 

6.7.1.2 Compounding Period (sub period size)

The compounding period specifies the period to which returns and volatilities are being compounded (also see Compounding period). The compounding period also specifies the size of the sub periods for which returns are shown in the “Period Returns” table.

 

6.7.1.3 Risk Free Rate

The Risk Free Rate is used for the calculation of the Sharpe Ratio, Alpha, and Risk-adjusted Return on the Performance Overview. The Risk Free Rate is also used as the minimum acceptable return for the calculation of the Sortino Ratio. See the discussion of these data series in the Data series reference for more information.

 

6.7.1.4 VaR Confidence Level

The VaR Confidence Level is used for the calculation of the Value at Risk, Relative Value at Risk and the Risk-adjusted Return on the Performance Overview. See the discussion of these data series in the Data series reference for more information.

 

6.7.2 Status information

In the top-right, some status information is shown. This includes the following information:

 

6.7.3 Performance calculation

The indicators under the headings “Return”, “Relative Return”, “Risk” and “Reward/Risk Ratios” are calculated by the corresponding data series in the “Trading System\Trading Simulator” subcategory of the data series tree view. They use the performance calculation settings as parameter values where applicable. However, the following indicators use alternative parameter values:

 

See 8. More about Data Series for general information about when and why data series return no value due to insufficient data or memory limitations. See Data series reference for information about how specific data series are calculated.

 

6.7.4 Sub period information

The Performance Overview contains a table of sub period returns for the Trading Simulator and for the Security itself (serving as a benchmark). The sub period length is equal to the specified compounding period length. The column headers show the start date/time of the corresponding period (using the same formats as the X-axis labels in charts). Note that period start dates are defined by the first quote bar of the new period. Partial periods are also included in the table and marked with a “*”. For example, if the calculation period started after the start of a period, this first period is a partial period. While the current model date is before the end date of a period, the last period is a partial period. Note that the return of the last (partial) period is recalculated every new bar until the period is complete.

 

Below the table, the average and standard deviation of the Trading Simulator period returns are shown. (Because this is an arithmetic average, it is not equal to the compounded return shown under “Return” which is a geometric average). Also the number of “winning” and “losing” periods and their average returns are shown. A winning period is a period with a Trading Simulator return greater than 0%. A losing period is a period with a Trading Simulator return less than 0%. Periods with a Trading Simulator return of exactly 0% are not counted as a winning or losing period. For this reason the total number of winning and losing periods can be less than the total number of periods. Note that in the numbers of winning and losing periods also the last (partial) period may be included whose return is recalculated every bar. The numbers may therefore go up or down by 1 every bar.

 

If the number of requested periods is greater than 500 then only the first 500 periods will be shown in the table. However, all periods will be included in the calculations.

 

 

6.8 Market Depth

The Market Depth window shows the depth of the orderbook of the Virtual Market and provides further insight into the virtual market pricing mechanism. In the bar chart, the total volume of outstanding buy and sell limit orders is shown at each price. By default, the situation before clearing is shown. Blue bars represent buy volume, red bar represent sell volume and yellow bars represent buy and sell volume at the same price[36]. The clearing price is indicated above the chart[37]. Note that volume from market orders is not included in the bars.

 

By clicking the button “show orders before clearing” in the toolbar, you can switch between views of the orderbook before or after market clearing. This way you can easily see what volume was traded at what prices during the last virtual market clearing[38]. After clearing, the buy volume to the right of the clearing price (higher bid prices) and the sell volume to the left of the clearing price (lower ask prices) should mostly have disappeared[39].

 

By clicking the button “show cumulative volumes” in the toolbar, cumulative volumes can be shown. This shows the cumulative volume of buy (sell) orders with a limit price at or above (below) each price, or in other words the total volume of buy (sell) orders that could be traded at each price if that price were to become the clearing price (provided that sufficient sell (buy) volume is available).

 

By clicking the button “Show order numbers”, an overlay window is shown with a summary table of the number of buy and sell orders grouped by limit and market orders.

 

The price range to show can be set in the toolbar. The price range is expressed in a number of standard deviations of price changes above and below the clearing price. The actual price range shown is an approximation of this and is kept as stable as possible for viewing comfort. By selecting larger price ranges, the shown range will change less often. By selecting “All”, the exact total price range of the orderbooks will be shown (which will cause the shown range to change almost every bar).

 

 

6.9 Agent Window

The Agent window gives an overview of a single agent containing its wealth, return, genome statistics, etc. Actually, the Agent window shows a particular Agent slot in the population. Therefore, when an agent that is occupying the slot being shown is terminated, a new agent takes over that slot and is shown in the Agent window. This can easily be seen by the agent age being reset to 1.

 

The Agent window is a multiple-instance window type meaning that multiple agent windows can exist simultaneously. Agent windows can be created through the View menu (see 6.11.7 Creating window instances). When creating a new Agent window, you are asked for the number of the agent slot to be shown. This number can later be changed in the Agent window using the numeric up/down control. Pressing the up/down keys or buttons provides fast browsing through all agents.

 

Most fields in the Agent window directly correspond to Agent data series. In addition, the agent’s amount of cash and the number of shares it holds in its portfolio (long or short) are shown.

 

6.9.1 Showing an agent’s genome

By clicking on the button “Show genome…” in an Agent window, the agent’s genome (its trading rule) can be shown. This is mostly for illustrative purposes and to get a general impression of the genomes and their structure. Note that in general, genetic programs are not meant to be read by people. They often seem illogical and inefficient, if not incomprehensible. For understanding the genomes it is necessary to read III. Genetic programming in Adaptive Modeler. The genomes are written as s-expressions that are formatted with extra tabs and line breaks to show their hierarchical structure. Every “column” corresponds with a hierarchical level of the genome’s tree. The root node (the start of the genome) is shown at the top left (first column). Its argument nodes are shown below each other in the second column. Their argument nodes are shown in the third column, etc. Nodes of the same level are aligned exactly below each other. (If the window were to be rotated 90° clockwise, the hierarchical structure would be shown in a top-down orientation with the nodes being “right-aligned”).

 

Note: While viewing an agent’s genome during model evolution, the agent may be replaced by another agent in the meantime. In that case, no warning or indication is given and the old genome is still being shown as long as the genome window is open. To prevent this, pause the model before viewing an agent genome.

 

6.10 Logger

The logger stores various non-critical notifications that are being generated during model evolution that may be of interest to the user. The meaning of specific notifications is explained elsewhere in this User’s Guide in the relevant sections.

 

The logger shows notifications in ascending order of their log time, meaning that the most recent notification is always at the bottom. Scroll up to see earlier notifications. To have the logger always show the most recent notification, place the cursor in the most recent notification. To keep showing another (earlier) notification, place the cursor in the desired notification. Then the logger will not jump to new notifications. It may be helpful to pause model evolution while browsing through the logger.

 

 

6.11 Customizing the User Interface

Adaptive Modeler offers a customizable user interface that enables you to rearrange windows as desired. The arrangement of windows (including user created window instances) are part of the Style.

 

6.11.1 Showing a window

A window can be shown by selecting it in the View Menu. Some items in the View menu have a submenu. These are for window types for which multiple instances can be created. For instance it is possible to create multiple “Charts” windows. To show a window of a multiple-instance type, first open its submenu and then select the instance to be shown. If no instances exist in the submenu, then select “Customize…” to create a new instance window.

 

6.11.2 Maximizing a window

A window can be maximized by clicking on the maximize button near the top-right corner of the window title bar. A window can also be maximized through its context-menu (right-click on the window’s tab or title bar). Maximizing a window will make all other windows invisible until the maximized window is de-maximized (restored) again by clicking on the de-maximize button or by clicking “Restore” in the window’s context-menu. A window can also be maximized or de-maximized by double clicking on the window title bar.

 

6.11.3 Hiding or closing a window

A window can be hidden (closed) by clicking on its exit button in the top-right corner of the title bar, by deselecting it in the View menu or through its context-menu (right-click on the window’s tab or title bar). Hiding a window does not delete anything, it just closes the window until it is opened again. A hidden window can be shown again through the View menu.

 

6.11.4 Resizing windows

Windows can be resized by moving the horizontal or vertical splitters that exist between windows.

 

6.11.5 Moving windows

A window can be moved to another location by dragging and dropping it by its title bar. (Tabbed windows can also be dragged by their tab). While dragging a window across the screen, a shaded area will mark the new location the window will get when it is dropped. When a full window is shaded, the dragged window will appear as a tab of the shaded window. When only part of a window is shaded, the window area will be split in two parts to show the dragged window and the shaded window together.

 

6.11.6 Reordering tabs

Window tabs can be reordered by dragging and dropping them to another location in the tab bar below the window.

 

6.11.7 Creating window instances

Certain window types such as “Charts”, “Population” and “Agent” are multiple-instance types. This means that several instances of these window types can co-exist at the same time, providing more flexibility to view various data simultaneously. To create a multiple-instance type window, first open the type’s submenu in the View menu and then select “Customize…”. A window will appear that lists all the existing windows of that type (if any). Click “Add…” to create a new instance. Depending on the window type you will be asked for a name for the instance or any other parameter values. After clicking OK the instance window will be created and appear in the list.

 

6.11.8 Deleting a window instance

To delete a window instance of a multiple-instance window type, open the window’s context menu (right-click on the window’s title bar or tab) and click “Remove”. Alternatively, open the type’s submenu in the View menu, select “Customize…”, select the instance to be deleted in the list and click “Delete”.

 

6.11.9 Renaming a window instance

To rename a window instance of a multiple-instance window type, open the window’s context menu (right-click on the window’s title bar or tab) and click “Rename…”. Alternatively, open the type’s submenu in the View menu, select “Customize…”, select the instance to be renamed in the list and click “Rename”.

 

Note that not all multiple-instance window types can be renamed. For instance, the names of “Agent” windows are automatically set to “Agent n” where n is the number of the agent slot being shown.

 

6.12 Styles

A Style is a collection of user interface settings such as the selection of data series in Charts windows and the Current Values window and various other presentation elements such as window arrangement. Also the Performance Calculation Settings and some export settings are part of the style. When a model is being saved, its style is automatically included in the model file so that when the model is re-opened, the style is automatically restored.

 

It is also possible to save a model’s style as a separate Style file (extension *.aps) which makes it possible to apply the style to any other model. This makes it easy to apply a particular style to multiple models without having to recreate the style for every new model. Saving and applying styles can be done with the “Save Style…” and “Apply Style…” commands in the File menu.

 

A style only contains elements that affect the presentation of a model, not its contents or parameters. Applying a style to a model does not in any way affect the state or evolution of the model. However, keep in mind when applying another style to a model, that the export settings may change too and that the history of any non-recomputable data series will be lost (see 8.4 Recomputable vs. non-recomputable data series). When using non-recomputable data series, it is recommended to save the model before (temporarily) applying another style so that the model (with the original style and history) can be restored by reverting to the saved model.

 

6.12.1 Default style

The default style that will automatically be applied to new models can be specified in the “Options” dialog box from the “Tools” menu. Any valid style file can be entered here, including user created styles. Adaptive Modeler comes with a few pre-defined styles. These are located in the Styles folder in the application’s program folder. 

 


6.13 Computation performance issues

 

Model evolution speed depends on various factors such as the population size, the average genome size and depth, the evolution parameters and the gene selection. For instance, the Technical Indicator genes generally require more computation time than most other genes. Also, some gene selections may result in very slow creation of trading rules (but this can be tested in advance with the Genome Creation and Mutation Tester).

 

Also the Style has an effect on evolution speed. Generally, model evolution is fastest when all Charts, Population, Agent and Performance windows are closed or otherwise not visible. If a Charts window is visible, longer chart periods may require more computing time than shorter chart periods. If the Performance Overview is visible, many sub periods and/or long calculation periods may require more computing time.

 

Certain data series such as Statistical Simulations can require a lot of computing time depending on their parameters.

 

Running multiple instances of Adaptive Modeler simultaneously (either manually or by using batch mode) will fully utilize multiple CPU’s or multi-core CPU’s if present.

 


7. Trading

 

7.1 Evaluating forecasting success

When reviewing the forecasting abilities of a model, in particular the Forecast Directional Accuracy should be examined. Values above 50% indicate that more often than not the direction of price change was forecasted correctly. The Forecast Directional Area Under Curve indicates to what extent any forecasting accuracy is caused by actual predictive abilities or simply by luck or biased data. Also the Forecast Directional Significance should be taken into account.

 

Other data series to judge forecast accuracy are the Forecast Error, Mean Absolute Error, Mean Squared Error, Root Mean Squared Error and Right/Wrong Forecasted Price Changes.

 

To conclude whether or not a model has acquired significant forecasting abilities, a sufficient number of quotes should have been processed for statistical significance. Often a model will show periods of good forecasting alternated with periods of poor forecasting. The user should evaluate whether or not a model has acquired sufficient forecasting abilities overall. The Trading Simulator can be of help in this process but be aware that the performance of the Trading Simulator is also affected by factors other than the model’s forecasting success. These factors include the security’s volatility, broker commission, spreads, and other Trading System parameters. When these factors are unfavorable the Trading Simulator can have very poor returns even when forecast accuracy is high. It is therefore recommended to also use the Statistical Simulations to observe the effects of different values for these factors on the potential returns.

 

7.2 Using the Trading Simulator

The Trading Simulator simulates trading based on the trading signals. It shows you what returns would have been made from actually trading according to the trading signals during a previous period and/or what returns are being made presently if the trades are actually executed. The broker commissions, spread and slippage as specified in the Trading System Parameters are taken into account by the Trading Simulator. However, small differences between the way the system administers trades and the actual execution of trades may cause differences between the Trading Simulator and reality. It is therefore important to enter accurate values for the Trading System parameters if the Trading Simulator is to give a close representation of reality. See 3.2.2 Trading Simulator for details on how trades are simulated. See I.3.2 Trading Simulator for a description of Trading Simulator data series.

 

The Performance Overview (accessible through the “View” menu) offers extensive possibilities to analyze the Trading Simulator’s performance using various risk and return indicators. For more information see 6.7 Performance Overview.

 

The Trading Simulator can be enabled or disabled. Disabling trading is particularly useful at the start of a new model when the model has not yet acquired any consistent forecasting skills. For this reason trading is disabled by default at the start of a new model. You should decide whether or not to enable the Trading Simulator, after evaluating whether sufficient forecasting skills have been demonstrated by the model.

 

Note that the value of an existing short position will become less than -100% when the security price increases. The Trading Simulator does not simulate any margin maintenance requirements and there is no limit to the allowed leverage of an existing position. This does obviously not conform to reality. However, in most cases the Trading Simulator would need to hold a short position for a relatively long period of time before the value of the short position would exceed realistic margin maintenance requirements.

 

It is assumed that it is possible to trade the security at or near the last price on which the signal was based. For example, when using hourly quotes, a signal that was generated based on the 10am quote will be available shortly after 10am (after the quote has been received and the forecasts has been calculated). Any trade (simulated or real) based on this signal will obviously occur later than 10am and the market price may then have changed since 10am. The slippage parameter on the “Trading System” tab of the “Model parameters” dialog box can be used to specify the average expected change in price. This parameter will be used by the Trading Simulator (and by the Statistical Simulations) to calculate the order execution price. Slippage will not be a problem as long as the difference in price is small compared to the average expected quote interval volatility. However, when using daily quotes for securities whose price might be affected by overnight events such as trading in related securities in other geographic regions, the next day’s opening price could be structurally different than last day’s closing price.

 

7.3 Statistical Simulations

While the Trading Simulator offers insight into the past and present performance of trading based on a particular model’s forecasts, it does not give insight into the potential range of (future) returns of multiple models (runs) and its sensitivity to influential factors such as volatility and Forecast Directional Accuracy.

 

It is important to realize that future returns can end up anywhere within a range determined by the values of such factors (given a certain level of confidence). So even if all factors are being considered to remain constant, future returns are still subject to a certain range. Obviously it is important to know this range. Furthermore, if one or more factors are going to change in the future, the range of future returns could change dramatically.

 

With the statistical simulations included in Adaptive Modeler, you can study the likely range of returns and its sensitivity to changes in its underlying factors. The simulation tools included are Historical and Monte Carlo simulations. Both are implemented as data series and are further described in I.3.3 Statistical Simulations.

 


8. More about data series

 

This chapter discusses some general issues about data series. All individual data series are described in detail in Appendix I.

 

8.1 Parameters

 

Some data series have parameters. When adding a data series with parameters to a chart or Current Values window, a dialog box appears allowing you to enter parameter values. (For some data series the parameter dialog box does not appear automatically but can be opened through the context menu after the data series has been launched).

 

To change the parameter values of an existing data series in a chart, activate the context menu of the chart (by clicking the right mouse button), select the data series and then select “Parameters…”.

 

To change the parameter values of an existing data series in the Current Values window, move the mouse to the row containing the data series, activate the context menu (by clicking the right mouse button) and select “Parameters…”.

 

For most parameters, minimum and maximum values apply. When you enter an invalid value, the parameter will be reset to the last used valid value when you leave the field or click “OK”.

 

Once the data series has been added to a chart or the Current Values window, the values of its parameters will be shown behind its name.

 

Parameters can be a calculation period, calculation method or other specific parameters.

 

8.1.1 Calculation period

For some data series you can set the “calculation period”. The calculation period defines the historical data that will be used for calculating the data series values. This is relevant for returns, FDA and other values that can be calculated over a historical period. Depending on the particular data series and where it is being shown, the following calculation period modes can be available:

 

Trailing n bars

The calculation period is always the last n bars and thus moves forward with every new processed bar. (The length of the calculation period stays fixed).

 

Trailing n periods

The calculation period is always the last n periods of the specified size and thus moves forward with every new processed bar. (The length of the calculation period stays fixed). Note: the specified period size here is NOT used as the compounding period. When a compounding period needs to be specified, this is done either in the Calculation method or with a separate Compounding Period parameter.

 

Since model start

The calculation period starts with the model evolution start bar and ends with the current bar. (The calculation period expands with model evolution). For Trading Simulator data series, this mode is irrelevant and therefore not available.

 


Since Trading Simulator start

The calculation period starts with the Trading Simulator start bar and ends with the current bar. (The calculation period expands with model evolution). The Trading Simulator start bar is the first bar at which the Trading Simulator became enabled during model evolution (regardless of how often the Trading Simulator was disabled or enabled again later).

 

Since date

The calculation period starts at the specified date/time and ends with the current bar. (The calculation period expands with model evolution).

 

Fixed date range (From … to …)

The calculation period starts at the specified start date/time and ends at the specified end date/time. (The calculation period neither expands nor moves with model evolution).

 

These modes are available when showing a data series in the Current Values window. In charts, for most data series only the trailing modes can be used because it wouldn’t make sense to use an expanding calculation period or a fixed date range in a chart. (There are some exceptions such as the data series (TS) Return, TS Maximum Drawdown, Historical Simulation and Return Distribution).

 

When a calculation period is specified that starts before the model start bar or before the Trading Simulator start bar, the data series may return no value since not enough data is available. Also, if the calculation period starts or ends after the current model bar, the data series returns no value.

 

 

8.1.2 Calculation method

For some data series (i.e. Return and TS Return) the calculation method can be specified. The following methods are possible:

 

Cumulative

The cumulative return over the calculation period is calculated.

 

Compounded

The return over the calculation period is compounded to the specified compounding period size. (The compounding period size may be different than the period size used for the “Trailing n periods” calculation period mode).

 

8.1.3 Compounding period

Some data series have a “Compounding period” parameter (either as part of the Calculation method or as a separate parameter). The compounding period indicates the period length (i.e. day, month, year) to which values such as return or volatility should be compounded (converted). This allows easy comparison of different data series even when their output is based on different historical period lengths.

 

The “Compounding period” parameter is set to “Year” by default.

 

Some data series (i.e. Return) will not return a value if not at least 75% of one compounding period of historical data is available in the calculation period. This is to ensure that returns are not being compounded to periods that are much longer than the period over which they were calculated, which would produce unreliable results. For this reason it may be useful to select a shorter compounding period (i.e. day or month) when working with small quote intervals that require a very large number of bars to fill a year.

 

Statistical Simulation data series may be compounded to any period. However, inadequately chosen combinations of calculation period, compounding period, number of simulations and investment horizon may produce statistically unreliable or extreme (though correct) results. See also the documentation of the Simulation data series.

 

Note that for compounding data series to other periods the Market Trading Hours settings are used to calculate the number of periods. Historical changes of the Market Trading Hours are being recorded and are used to calculate the number of actual periods (by trading time) during the calculation period for accurate calculation of returns, volatility and other indicators. Nevertheless, incorrect Market Trading Hours settings as well as frequently missing bars can cause (slight) distortions in compounding conversions. Changes in Market Trading Hours also may cause slight distortions around the time when the change occurred in compounded data series.

 

8.2 Moving Averages

 

For most data series it is possible to add a moving average. A moving average will appear as a separate data series in the chart or Current Values window that contains its source.

 

To add a moving average, activate the context menu of the source data series (in a chart or the Current Values window) and select “Add moving average…”. (If it is not possible to select “Add moving average…” then this data series can not have a moving average). A dialog box will appear asking for the number of historical bars (values) that should be included in the moving average calculation.

 

When adding a moving average series to a chart, also an option to hide the source data series is available. If this option is checked, the source data series will still exist in the chart but won’t be visible. It is still possible to access the source data series through the chart context menu, for instance for changing its parameters (which will be reflected in the moving average series as well) or for creating additional moving averages. To make the source data series visible again, open the “Parameters…” dialog box of the moving average series and uncheck “Hide source”.

 

The name of the moving average data series above the chart will be the name of its source followed by “MA (n)” where n is the number of historical bars. A moving average can only exist together with its source. If the source data series is removed, the moving average is also removed.

 

8.3 Autocorrelation

For some data series it is possible to add an autocorrelation indicator. Like a moving average, an autocorrelation indicator will appear as a separate data series in the chart or Current Values window that contains its source. Autocorrelation indicators are available for data series such as Volume, Bar Return, Single Bar FDA, Forecast Error and some others.

 

To add an autocorrelation indicator, activate the context menu of the source data series (in a chart or the Current Values window) and select “Add autocorrelation…”. (If it is not possible to select “Add autocorrelation…” then this data series can not have an autocorrelation indicator). A dialog box will appear asking for the lag and the number of historical bars that should be included in the autocorrelation calculation. As for moving averages, when adding an autocorrelation indicator to a chart, an option is available to hide the source data series. This is especially useful for autocorrelation indicators because the value range of the source data series may be completely different than the range of autocorrelation values (which range from -1 to 1) which would make the autocorrelation indicator difficult to see in the chart.

 

The name of the autocorrelation data series will be the name of its source followed by “AC (k,n)” where k is the lag and n is the number of historical bars. An autocorrelation series can only exist together with its source. If the source data series is removed, the autocorrelation series is also removed.

 

For a source data series with values Xt where t is the bar number, with mean μ and standard deviation σ, the autocorrelation with lag k and n the number of historical bars to include in the sample, is calculated as:

 

 

8.4 Recomputable vs. non-recomputable data series

 

Recomputable data series are data series whose historical values can be computed at a later time. Non-recomputable data series can only be computed in real-time meaning that it is not possible to compute historical values from before the time the data series was started. The reas