• Ei tuloksia

Apendix 1.2‒ Technology developments as a growth factor for financial markets 20

3 Algorithmics of financial markets

3.6 Architecture of financial applications

Even though the variety of financial applications is wide, it is possible to pinpoint some architectural patterns than can be expected to occur on many of them, as the financial environment poses a number of requirements and conditions to financial applications in order to be effective. Financial applications include automatic high-frequency trading systems, applications performing financial transactions such as online banking portals and online insurance applications, and of course asset pricing modules. In general, there are four recurrent factors that influence more any than others the design of financial applications: i) the need for speed in performing the calculations (online computation), ii) the huge amount of information involved (big data), iii) the ubiquitous requirement of security, and iv) a UX design which effectively helps the user to better understand the market’s conditions. I selected three representative examples of architectures to explain.

1. Business client-server architecture.

Perroud & Inverisino (2003) describe a generic computational finance application architecture, comprising two main parts:

a) “backend” server, which contains the implementation of internal market services and which is not visible to the market participants who are end,-users of the application. This server hosts the bulk of the business logic of the financial application, and

b) “frontend” application server, accessed by other market applications and users. This server provides the presentation services and performs I-O operations.

Communication between servers may occur through standard or proprietary protocols, like for example RPCs (remote procedures calls) while inter-application communication can be achieved through web services, microservices182 and secure information interchange protocols.183

181 Heaton, Cris Sholto. ‘The dangers of derivatives’. Money Week magazine. September 27, 2006.

[Please note: article written before the mortgage market crisis]. Available at:

https://moneyweek.com/the-dangers-of-derivatives/

182 There is no formal definition of the term microservices, but essentially, microservice architecture is <<a method of developing software applications as a suite of independently deployable, small, modular services in which each service runs a unique process and communicates through a well-defined, lightweight mechanism to serve a business goal>>.

Sources:

Huston, Tom. ‘What is Microservices Architecture?’. SmartBear. Available at:

https://smartbear.com/learn/api-design/what-are-microservices/

Lewis, James and Fowler, Martin. ‘Microservices - a definition of this new architectural term’. 2014.

Available at: https://martinfowler.com/articles/microservices.html

183 Perroud, Thierry and Inversini, Reto. Enterprise Architecture Patterns: Practical Solutions for Recurring IT-Architecture Problems. Springer-Verlag, 2003. The figure is in page 137.

56 One aspect to highlight from this architectural example is the importance of efficient communications between the business processes (clients) and the main application server offering the services. The database is accessible only through the back-end system, so performance is a concern. Finally, observe the multiple validation and protection artifacts, suggesting security is key.

2. Financial web architecture.

Shivakumar and Krishnamurty (2017) presents a high level overview of a sample finance web application184: From the architectural disposition of the components, it’s clear that user interface is of significant relevance. Users should get a clear picture of the application functioning processes.

The layered organization of the architecture is a reflection of the design-implementation process, which allows not only for a clearer picture regarding the architecture itself, but the refinement process the interaction with the user goes through in order to provide the service. Finally, information management adjust to a precise template, for example for user identification and control,

184 Shivakumar, Shailesh Kumar and Krishnamurty, Babu. “Security Basics for Financial Applications”.

Infosys White Paper, 2017.

57 3. Algorithmic Trading System Architecture

Since trading intends to be a quite regulated activity in financial markets, there is also a systems and software engineering trading architecture description standard: According to it, an architecture description must:

a) contain multiple standardized architectural views (e.g. in UML) and

b) maintain traceability between design decisions and architectural requirements.

System architecture influences just about everything in the process of developing software. In the context of financial instruments trading, architecture is defined as <<the infrastructure within which application components satisfying functional requirements can be specified, deployed, and executed. Functional requirements are the expected functions of the system and its components.

Non-functional requirements are measures through which the quality of the system can be measured. >>185

Conceptually, the algorithmic trading system is an exemplification of an event driven architecture (EDA) broken up across four layers, and two architectural aspects. For each layer and aspect reference architectures and patterns are used186.

185 Reid, Stuart Gordon. ’Algorithmic Trading System Architecture’. Turing Finance. Available at:

http://www.turingfinance.com/algorithmic-trading-system-architecture-post/.

186 Some terminology explained:

58 3.7 Right answers, wrong questions: artificial financial markets and virtual financial operations Since at least 25 years, artificial worlds have been described as class of models designed to give insight into the emergent hierarchical organization process (ERO), under the argument that many economic phenomena seem to manifest that kind of organization internally. However, it was then recognised that there are some formidable inferential difficulties that needed to be overcome before artificial worlds modelling could become an acceptable research tool187. An artificial market is a virtual financial market188 run on a computer. With artificial markets built, one could attempt to model and examine decision making processes procedurally (i.e., embedding such processes in computer programs)189. So, agents participate in them as computer programs that play different roles, for example, virtual dealers. Parametrization is key for an adequate simulation190.

Event driven architecture is a conceptual artifacts which manages and reacts to events (production, detection, consumption). Events include real time market movements, trends/patterns in the behaviour of financial variables as well as specific trading events, e.g. submitting an order.

Architectural aspects are cross-cutting concerns which span multiple components.

Architectural patterns are proven, generic structures for achieving specific requirements.

Reference architecture consists of a pattern which separates the representation of information from the user's interaction with it; and the arrangement where loosely coupled processing units interact with one another through a shared associative memory called space.

187 Lane, David A. “Artificial Worlds and Economics”. Santa Fe Institute. 1992.

188 The term virtualization has been used/abused widely in the literature, meaning different things in different contexts, often wrong. Virtualization is substantiated when a certain reality is split in such a way that two conditions are met:

1) There is a strict dependence relationship between the two resulting parts (A and B), in the sense that one of them, let’s say B, cannot exist without A, but the existence of A does not depend on B in any way.

2) The events that occur in each part (A or B) after the splitting are completely independent from the events occurring in the other part, so no influence of one part into the other can be detected.

189 Tsang, Edward and Isasi, Pedro. Editorial Special Issue: Computational Finance and Economics.

IEEE Transactions on Evolutionary Computation, Vol. 13, No. 1. © IEEE. February, 2009.

190 Grüne-Yanoff, Till. “Artificial Worlds and Agent-Based Simulation”. In: Jarvie, Ian & Zamora-Bonilla, Jesús (Editors). The SAGE Handbook of the Philosophy of Social Sciences. First Edition. SAGE Publications Ltd. March, 2014.

59 Artificial economies/markets have been used to model different aspects of the financial reality:

 The connection between the business cycle, financial intrinsic time and scaling patterns of financial turbulence.191

 Clarify the conditions that make prediction markets effective.192

 The behaviour of stock markets under different perspectives. For example, a study based on agent differentiation (model technical, fundamental and noise traders193) or on the constitutive parts of designing an artificial stock market: economic environment, agent’s behaviour and price formation194.

 Coordination/convention issues between financial entities. From a policy-based analysis view, the economy is based on conventions. For example, firms in the private sector behave in an information environment in a way it resembles that of its neighbours: if a firm observes that other firms’ actions lead to a good pay off, then the behaviour is imitated195.

 Information asymmetries. Stanković & Radović (2012) investigated the distribution of information and investors’ expectations, finding that wealth is reallocated in favour of better informed agents, but “uninformed” agents can reduce the information gap in a number of ways.196

 Emergence of properties: artificial models as complex systems.197

A refinement of the concept of artificial economy is the concept of artificial stock markets. These are models of financial markets used to study market dynamics. More specifically, agent-based artificial stock markets can be seen as any market model in which prices are formed endogenously as a result of participants’ interaction and in which the representation of participants varies from simple equations of forecast functions to intricate software components endowed with human-like artificial intelligence based adaptive behavior198. There are various artificial stock markets in existence that are created using different strategies and customized for specific requirements: Santa Fe Artificial Stock Market (SF-ASM), Genoa Artificial Stock Market (GASM), Taiwan ASM, Agent Based Model for Investment (ABMI), Business School (BS) and Baron’s Model (BM), all being call market or discrete time sessions.

191 Gonçalves, Carlos Pedro. “Financial Turbulence, Business Cycles and Intrinsic Time in an Artificial Economy”. Algorithmic Finance 1, pp. 141–156. 2011.

192 Toriumi, Fujio and Ishii, Kenichiro. “Analysing Prediction Market Mechanism using Artificial Markets”. SICE Annual Conference, Waseda University, Japan. September, 2011.

193 Martínez-Jaramillo, Serafín. “Artificial Financial Markets: An Agent Based Approach to Reproduce Stylized Facts…”. Ph.D. Dissertation. Centre for Computational Finance and Economic Agents.

University of Essex. June, 2007.

194 Liu, Xinghua; Yang, Jianmei and Tang, Bingyong. “A New Agent-Based Artificial Stock Market with Short-Term Dynamics”. 2007 International Conference on Wireless Communications, Networking and Mobile Computing. © IEEE, 2007.

195 Lozano, Fernando; Lozano, Jaime and García, Mario. ” An Artificial Economy Based on Reinforcement Learning and Agent Based Modelling”. April, 2007.

196196 Stanković, Jelena & Radović, Ognjen. “Information Asymmetry in the Artificial Financial Market represented by Scale-Free Network”. Management, Knowledge and Learning International Conference, 2012.

197 Chen, Shu-Heng and Yeh, Chia-Hsuan. “On the emergent properties of artificial stock markets:

the efficient market hypothesis and the rational expectations hypothesis”. Journal of Economic Behavior & Organization, Vol. 49, pp. 217–239. 2002.

198 Kumar, PN; Jha, Ashutosh; TK, Gautham; Mohan, Jitesh; Subramanian AJ, Rama and Mohandas, VP. “Survey of Call Market (Discrete) Agent Based Artificial Stock Markets”. International Journal on Computer Science and Engineering (IJCSE), Vol. 02, No. 09, pp. 3025-3032. 2009.

60 Schulenburg & Ross (2002)199 propose a schematic description of how ‘real’ and ‘artificial’ modelling are related to each other:

1) Real financial markets are affected by world news of various types (economic, political, environmental, etc.)

2) This in turn affects the participants acting in the stock markets, in terms of expectations and sentiment.

3) If expectations and sentiment are updated locally, global market conditions are also updated and market dynamics reflect those changes: stock prices, volume of transactions, etc.

4) A subset of these real market conditions, labelled as market data, is fed as an input into ‘real’

predictive/decision models; these decisions generally have an effect on the market, scaled according transaction’s size and information asymmetries. ‘Artificial’ markets, on the other hand, are fed with artificial data.

5) The output data of all both model classes are then compared (calibration).

In any case, the final reflection here is that artificial finance, though being a valuable tool for modeling purposes, is not necessarily the correct vehicle to infer knowledge about actual, real financial markets from the analyst experience. It is necessary to provide insight as if it is possible to infer, from the existing financial models, if computational finance can be considered as relevant factor for the virtualization of the financial environment and how extensive that virtualization can or should be.

The already developed artificial models work, no doubt. They provide us with the correct answers. It is however, the questions which might be wrong.

199 Schulenburg, Sonia and Ross, Peter. “MODELLING REAL AND ARTIFICIAL FINANCIAL MARKETS”.

Tutorial. Evolutionary Computation Research Group, Napier University. © Schulenburg-Ross, July 2002.

61 Appendix 3.1: Financial price anomalies.

From the discussion of Chapter 2, we know that the EMH, which is the starting point for the characterization of information dynamics in a financial market, rest over two basic assumptions:

(i) completely rational information processing, and

(ii) complete knowledge of the fundamental structure of the economy

Since the EMH rests over a solid axiomatic framework, and the availability of information is also assumed to be unconstrained, a relatively straightforward computational interpretation of the financial environment is possible, and in such a world, computational financial apps would be expected to mirror the inner workings of the markets quite well. As for price theory implications, pricing models under these assumptions are supposed to get “correct prices” because access to the 'true' economic model and to unbiased estimators of its coefficients is possible200.However, the EMH does not always hold when subjected to rigorous empirical testing, and prices does not follow expected path, considering the information available. These departures from theory are called financial price anomalies. A financial price anomaly is <<a documented pattern of price behaviour that is inconsistent with the predictions of traditional efficient markets, rational expectations and asset pricing theory>>201. The study of financial price anomalies is performed through the relaxation of the basic assumptions listed above. The relaxation of the first assumption (i) take us to behavioural models, while the relaxation of the second (ii), to structured uncertainty models.

In behavioural theories (rational information processing assumption is given up), investors do not process available information rationally because they suffer from cognitive biases. However, irrational still have considerable structural knowledge about the financial environment. The cognitive biases occur even if the investors have the ability to observe relevant data generating processes202, Nonetheless, investors would act irrationally despite having considerable knowledge about the fundamental structure of the economy.

200 Friedman, Benjamin M. "Optimal Expectations and the Extreme Information Assumptions of 'Rational Expectations' Macromodels". Journal of Monetary Economics 5, p. 38, 1979.

201 Brav, Alon and Heaton, J.V. “Competing Theories of Financial Anomalies”. The Review of Financial Studies, Vol. 15, No. 2, 2002p. 575-606, 2002.

202 As an example of … Hong & Stein (1999) study the interaction of traders who naively follow price trends and traders who naively study fundamental news. Source: Hong, Harrison, and Jeremy Stein, 1999, "A unified theory of underreaction, momentum trading,

and overreaction in asset markets," Journal of Finance 54(6), 2143-2184

62 Structural uncertainty models actually maintain the complete rationality assumption, that is, agents in are still axiomatic but the information about the structure of the economic environment is incomplete. As a result, two anomalies arise: overreaction and underreaction of the agents toward the events they observe.

A final consideration refers to the possible existence of unstructured uncertainty within financial models. Unstructured uncertainty consist of unmodelled uncertainty, either because it can’t be modelled properly or because the parameters required for modelling it cannot be calculated/estimated. Under these circumstances, the robustness of the agents’ decision-making can be compromised. For example, conflicting goals regarding resource allocation.

63 Appendix 3.2: Methodological aspects of computational finance

applications

A methodology is an organized set of methods to solve problems and/or acquire knowledge.

Computational approach to financial problems is, at least in principle, not different from the one used in any other field; i.e. problems are tackled by a combination of algorithm design and data management. In the case of computational finance it happens that the applications often have to deal with huge amounts of data; and the nature, size and availability of the data very much define the behaviour of the applications and design principles in use. Following is a brief discussion about l relevant methodological aspects of computational finance203.

Typology of philosophy and computer science. It concerns:

(a) the critical investigation of the conceptual nature and basic principles of information, including its dynamics (especially computation), are important for understanding the relation between a computational

203 Most of the information available about methodological issues in computational finance spin around the topic of computational methods in quantitative finance, specific techniques that can be used for the mathematical specification of information processing procedures, rather than a methodology for the computational finance as a field of study.

204 Greco, Gian Maria; Paronitti, Gianluca; Turilli, Matteo and Floridi, Luciano. “The Philosophy of Information - A Methodological Point of View”. Conference: 3rd Conference of Professional Knowledge Management - Experiences and Visions, April 10-13, 2005, Kaiserslautern, Germany.

64 solution206 to a requirement through the analysis and observation of theoretical

205 Complex problem solving (CPS) as a field belongs originally to the area of cognitive science, and has received considerable attention, but theories in the field have not progressed accordingly. The reasons could be the two main terms, namely “complexity” and “problem solving”, although used pervasively in almost any field of study and operationalized in different ways, lack a proper theory for sustaining its formal use on a generalized framework, or even a concrete definition within particular fields. Adequateness in the classification of the tasks (taxonomies) of a field is essential for defining CPS within it. After all, not everything complex requires problem solving and not every problem solving procedure deals with complexity. In the case of computer science, ‘computational complexity’ is a branch of theoretical computer science that focuses on classifying computational problems (the tasks) according to their inherent difficulty as to be solved by an algorithm, and grouping those of related resource-based difficulty into classes. However, the term “complex”

remains widely colloquially used as to refer to any task difficult enough to design, code or implement, regardless of the efficiency of the solution; or which involves huge amounts of data to be processed, that is subject to tight resource, time or budget constraints or even projects that involve the coordination of large developing teams.

Quezada, et. al. (2001, see reference below) provide a characterization of a representative real-word decision making process, which usually has three distinctive characteristics: (1) it is dynamic, because early actions determine the environment in which subsequent decision must be made, and features of the task environment may change independently of the solver’s actions; (2) it is time-dependent, because decisions must be made at the correct moment in relation to environmental demands; and (3) it is complex, in the sense that most variables are not related to each other in one-to-one manner.

Sources:

Quesada, José, Kintsch, Walter, and Gomez, Emilio. “Complex problem solving: a field in search of a definition?” Theoretical Issues in Ergonomics Science (Journal), Vol. 6, No. 1, January–February 2005.

Quesada, José, Kintsch, Walter, and Gomez, Emilio. “A Computational Theory of Complex Problem Solving Using the Vector Space Model (part I): Latent Semantic Analysis, Through the Path of Thousands of Ants”. In Cañas, J.J. (Ed.), Cognitive Research with Microworlds, pp. 117-131. Granada, Spain, 2001.

206 By solution here, it is only not meant the answer to the classical economic equilibrium-type problems. A solution can be for example a prediction (which is approximate by nature). Also, a model can be used as a tool to gain insight into the modelled situation, or as to provide conceptual clarity to the researcher or developer concerning the target pattern, not to mention that the process of modelling itself might help the modeler to identify elements present in the original reality that she overlooked or missed, or that were not evident at the time the model was first constructed but nevertheless the model was able to captured.

207 Here, it is important to establish the difference between two terms that are often confused among novices to finance and/or computational finance: ‘model’ and ‘strategy’. Generally speaking, model is an abstract representation of a real-world situation, characteristic or process,