Free Essay

Order Book Simulations Using Monte Carlo Methods

In: Science

Submitted By atin
Words 1053
Pages 5
Modeling Order Book Fluctuation by Monte Carlo Technique


Page no. 1) Certificate 2 2) Acknowledgement 3 3) Abstract 5 4) Introduction 6 5) Simulation code 8 ➢ Order Book 8 ➢ Diffusion 9 ➢ Price and Annihilation 11 ➢ One Trade return 14 ➢ Waiting time between consecutive trades 16 ➢ Conditional return 19 ➢ Hurst curve 20

6) Results and Discussion 22 7) Summary 28 8) Future Prospects 29 9) References 30


This Project aims to simulate Order Book Fluctuations in a typical Stock Exchange using random variables. We aimed to simulate Bak, Paczuski and Shubik model using ANSI C and compiler Code-Blocks. We Simulated the Order Book using a two dimensional array to get better accessibility and file handling. We used the random function generator to generate random variables .


Order Book : An order book is the list of orders (manually and now electronically) that a trading venue (in particular stock exchanges) uses to record the interest of buyers and sellers in a particular financial instrument.

Trading Engine : A trading engine uses the book to determine which orders can be fulfilled i.e. what trades can be made. Trades are done on the basis of matching between bids and asks.

Order Book Simulation : Order Book Simulation is used to predict the market behavior and estimate price based on various parameters like random variables used etc.

Need of Simulation : If we say that we simulate order book using random variables , then what is the predictability and usage of results in different environment or with different random variables. The question was first addressed by Hurst by inventing a new statistical method called Rescaled Range Analysis in which randomly generated data was analyzed and he got to the conclusion that even randomly generated data can have long range memory effect in some processes and data can be estimated on the basis of same technique. We simulate the order book to see that how predictable is the outcome on the basis of input given and see auto correlation between the two sets.

These simulation techniques steer modern investment portfolios of various investment firms , investment banks and Hedge funds. Now days simulation results are being provided by various consultancy firms to private investors for better investment strategies.

Bak , Paczuski and Shubik Model [31]

On a line representing the price axis, two kinds of particles are placed. The first kind, denoted A (ask), corresponds to sell orders, while the second, B (bid), corresponds to buy orders. The position of the particle is the price at which the order is to be satisfied. A trade can occur only when two particles of opposite type meet. If that happens, the orders are satisfied and the particles are removed from the system. This can be described as annihilation reaction A + B → ∅. It is evident that all B particles must lie on the left with respect to all A particles. The particles diffuse freely and in order to keep their concentration constant on average, new orders are inserted from the left (B type) and from the right (A type). The whole picture of this order-book model is therefore identical to the two-species diffusion-annihilation process. The changes in the price are mapped on the movement of the reaction front.

In this model there are N particles of each type, i.e. total 2N particles placed at the segment of length L. The particles can occupy integer positions from the set {1, 2, . . ., L}. In one update step we choose one particle and change its position as ci’=ci+1 or ci’=ci -1 (there is no bias, so both signs of the change have the same probability), on condition that the new position stays within the allowed interval, 1 ≤ ci’ ≤ L. We use the convention that the time advances by 1/(2N) in one step. If the new site was empty or there was already another particle of the same type at the new position, nothing more happens and the update is completed. We set ci(t + 1/(2N)) = ci’ and ck(t + 1/(2N)) = ck(t), k!=i . On the other hand, if the new site is occupied by a particle of opposite type, say, particle j, so that cj(t) = ci’, then the two particles annihilate. To keep the number of particles constant, we immediately supply two new particles at opposite edges of the allowed segment. E.g. if i was type B and j was type A, the update is ci(t + 1/(2N)) = 1, cj(t + 1/(2N)) = L and ck(t + 1/(2N)) = ck(t), k!= i, j. The annihilation corresponds to an elementary transaction.
The price set in this deal is just the position where the annihilation took place, x(t + 1/(2N)) = ci’. If the transaction did not occur, the price stays unchanged, x(t+1/(2N)) = x(t). This completes the definition of the variant of the BPS model simulated here.


Programing Language Used : ANSI C

Compiler Environment : Code Blocks

Total Number of particles in the system : 200 A type and 200 B type

Order book : The order is simulated as a two dimensional array of size[2N][L] as this simplifies the problem statement to a large extent. The column number represents the value of the element placed in it.

A sample array is shown below for reference :

1 |5 |5 |5 |5 |5 |5 |5 | |5 |1 |5 |5 |5 |5 |5 |5 | |5 |5 |1 |5 |5 |5 |5 |5 | |5 |5 |5 |1 |5 |5 |5 |5 | |5 |5 |5 |5 |9 |5 |5 |5 | |5 |5 |5 |5 |5 |9 |5 |5 | |5 |5 |5 |5 |5 |5 |9 |5 | |5 |5 |5 |5 |5 |5 |5 |9 | |

5 = Background element , 1 = B Type , 9 = A Type

All the background elements are taken as 5 to avoid ambiguities using conditional statements in C . All B type elements are taken as 1’s and all A type elements are taken as 9’s. Since all the elements occupy a unique row, horizontal diffusion will not change the number of particles in each row.

Initiating Array : The first step in the program is to initiate the 2N*L array and put all the elements at places as described above. Function written to initiate the array is given below

void set1(){


Similar Documents

Free Essay

Interpretation of Modeling and Simulation

...Interpretation of Modeling and Simulation Can there be a better fit for a company out there that uses Microsoft Excel to conduct modeling to simulate their business growth other than Microsoft itself? Microsoft has made billions of dollars selling their Microsoft Office Suites and their home computer operating systems around the world. They have become one of the largest and well known companies in the world. The way that I see it, is that Microsoft’s business model, in a nutshell, is to provide goods and services in the form of software and support to paying customers. One question that may be asked in this day an age is with the advances in cloud computing and Google’s “free” gadgets, will the traditional Microsoft’s business model come to an end? What will Microsoft’s business analysts do in order to change their business model? One can only imagine that it will need to be modeled and simulated first to avoid potentially expensive mistakes. I must start off by saying that before I started my Systems Modeling Theory online class through Strayer, I thought that it may just be one of the hardest classes to understand that I’ve ever taken throughout the course of my college career. I can say now after having completed the last nine weeks of class that I was correct. What’s hard, is not understanding the concepts of why businesses would use Excel models for their business growth but rather the actual use of Excel itself. With all of the bells and......

Words: 1781 - Pages: 8

Premium Essay

Using Perceptual Maps in Marketing Simulation

...Using Perceptual Maps In Marketing Simulation Using Perceptual Maps in Marketing Simulation Thorr Motorcycles manufactures a range of motorcycles. It also carries a wide variety of accessories and products from shoes to toys. The image Thorr Motorcycles perceive is that of freedom, masculinity, and mobility. Thorr Motorcycles offers various services, for example, dealer training, dealer software packages, rentals of bikes, and rider training. Thorr Motorcycles believes in having a high brand image in the market. However, sales have declined and therefore, a new strategy must be implemented. The situation The situation for Thorr Motorcycles is the number of the CruiserThorr motorcycles decreasing. The older target customers are growing older and losing interest in riding motorcycles. The younger target customers simply cannot afford the high lifestyle motorcycles. Decisions on the marketing strategy must be made to see what can be implemented to increase sales. Thorr Motorcycles must change the position of this product rather than opting to introduce a new designed motorcycle. Perceptual maps are used to compare attributes of products and services with the competitors to mark their position in the market and this is what Thorr motorcycles will use to find the attributes needed to reach customers again. Recommended Solutions To position a strategy, steps must be taken to choose the proper fundamental parameters. First, lifestyle image is......

Words: 1152 - Pages: 5

Premium Essay

Monte Carlo

...Monte Carlo Simulation Tutorial This tutorial shows how to use Microsoft Excel to develop Monte Carlo simulations without the use of add-ins or special software (such as @RISK or Crystal Ball). (Note, however, that there are some important advantages of using these dedicated software packages.) After completing the tutorial you should have a sufficient understanding of Monte Carlo concepts and Excel capabilities to begin building your own Monte Carlo simulations applied to a wide range of business problems, including the construction of short-term profit plans (otherwise referred to as “Cost-Volume-Profit” models, covered in Chapter 9 of the text). Monte Carlo refers to a widely used approach for solving complex problems using computer algorithms to simulate the variables in the model (e.g., a CVP model). Typically, an algorithm is developed to "model" the problem, and then the algorithm is run many times (from a few hundred up to millions) in order to develop a statistical data set for how the model behaves. Simple Example: Tossing a “Fair” Coin—Heads vs. Tails? For the simplest example, consider the basic coin toss. This is a process which has two possible outcomes (heads or tails), each with a 50% probability. In a million coin tosses, roughly half will be “heads” and half will be “tails.” A simple Monte Carlo simulation would support this conclusion. If you were to develop a spreadsheet with a random number generator resulting in 0 for “heads” and 1 for “tails,”......

Words: 2387 - Pages: 10

Premium Essay

Using System Dynamics in Business Simulation Training Games

...Using System Dynamics in Business Simulation Training Games by Jennifer Ching-Wen Han Submitted to the Department of Electrical Engineering and Computer Science in Partial Fulfillment of the Requirements for the Degree of Masters of Engineering in Electrical Engineering and Computer Science at the MASSACHUSETTS INSTITUTE OF TECHNOLOGY May 9th, 1997 © Massachusetts Institute of Technology, 1997. All Rights Reserved. Au th or ............................................................................. Departmenft-f Electrical Engineering and Computer Science May 9th, 1997 Certified by .... .................................. ................... Richard C. Larson _Th sis Supervisor Accepted by ........ ............ Arthur C. Smith Chairman, Department Committee on Graduate Theses ...... Using System Dynamics in Business Simulation Training Games by Jennifer Ching-Wen Han Submitted to the Department of Electrical Engineering and Computer Science May 9th, 1997 In Partial Fulfillment of the Requirements for the Degree of Masters of Engineering in Electrical Engineering and Computer Science ABSTRACT This thesis project includes researching and designing a system dynamics model for use in an existing Andersen Consulting Education (ACE) project management training game. This serves two major purposes. The first is to show how system dynamics can be used as a realistic and potentially superior method of business modeling. The second is to actually improve...

Words: 18414 - Pages: 74

Free Essay

Monte Carlo Simulation

...Monte Carlo simulations and option pricing by Bingqian Lu Undergraduate Mathematics Department Pennsylvania State University University Park, PA 16802 Project Supervisor: Professor Anna Mazzucato July, 2011 Abstract Monte Carlo simulation is a legitimate and widely used technique for dealing with uncertainty in many aspects of business operations. The purpose of this report is to explore the application of this technique to the stock volality and to test its accuracy by comparing the result computed by Monte Carlo Estimate with the result of Black-Schole model and the Variance Reduction by Antitheric Variattes. The mathematical computer softwear application that we use to compute and test the relationship between the sample size and the accuracy of Monte Carlo Simulation is itshapeMathematica. It also provides numerical and geometrical evidence for our conclusion. 0.1 Introduction to Monte Carlo Simulaion Monte Carlo Option Price is a method often used in Mathematical finance to calculate the value of an option with multiple sources of uncertainties and random features, such as changing interest rates, stock prices or exchange rates, etc.. This method is called Monte Carlo simulation, naming after the city of Monte Carlo, which is noted for its casinos. In my project, I use Mathematica, a mathematics computer software, we can easily create a sequence of random number indicating the uncertainties that we might have for the stock prices for......

Words: 3279 - Pages: 14

Free Essay


...INTRODUCTION: The purpose of this paper is to bring out the use of Simulation by Managers of various organizations. Under discussion will be:  Definition of simulation.  Model construction.  When and why it becomes handy to use simulation.  Steps used in simulation technique.  Random selection in simulation.  Advantages / benefits derived from use of simulation technique.  Disadvantages /Challenges associated with simulation technique.  Role of computer in simulation.  Conclusion / comments. Definition of simulation: Simulation can be defined as a quantitative technique which describes a process by developing a model of that process and then conduct a series of organized trial and error experiments to predict the behavior of the process through time often with the aid of a computer. It is a method that is used to solve a problem in many areas of management, for example inventory management, queuing problems, profit analysis and project management among others. Model construction: A successful simulation model has to be carefully designed in order to achieve the intended predictive purpose. Therefore important factors have to be considered such as; i. It must be objective oriented. It must be constructed for a purpose and be able to achieve that purpose. ii. Critical variables and relationships. These must be identified and incorporated in model. However it is not essential or indeed desirable to include all variables in the model. iii. Simplicity...

Words: 1498 - Pages: 6

Premium Essay

Simulation Methods

...shareholders’ wealth so that the company can receive funding in the next five years. Student’s task is to evaluate proposed projects using the financial and qualitative information provided and to select projects to be approved for a given year’s investment plan using any evaluation criteria deem appropriate. Students are to submit the simulation online and to write a final report in a formal business format based on the simulation. Case Study Instructions: This is an individual assessment. You are acting as the CEO of New Heritage Doll company and you need to decide which investment projects can create values for shareholders’ wealth, so that the company can receive funding in the next five years. Your task is to evaluate proposed projects using the financial and qualitative information provided and to select projects to be approved for a given year’s investment plan using any evaluation criteria you deem appropriate. There is more detailed information provided in the case study and you also can: 1. Review the Preparetab where you’ll learn about New Heritage and its corporate strategy; 2. Navigate the Analyze tab to view detailed financial reports at the divisional and company levels. Here you can also evaluate projections for each of the available projects; 3. Proceed to Decide tab to submit your final project decisions for that year; 4. The simulation advances to the next year and presents the financial results of your investments. The Case Study is a real-world......

Words: 1227 - Pages: 5

Free Essay

Using a Combined Method of Hierarchical Analysis and Monte Carlo Simulation in Order to Identify and Prioritize the Target Market Selection Criteria

...Applied mathematics in Engineering, Management and Technology 2 (2) 2014:466-475 Using a combined method of hierarchical analysis and Monte Carlo simulation in order to identify and prioritize the target market selection criteria (Case study: Food distribution companies of Mashhad-Iran) Amir kariznoee Ph.D. student of Industrial Management,University of Mazandaran ,Iran (Corresponding Author's E-mail: Monireh Bijandi Graduate of Accounting in Ferdowsi University of Mashhad,Iran Mahdi Ghayur Maddah Student of Public Management in Ferdowsi University of Mashhad,Iran Vajihe Mogharabi M.A. Student of Information Technology Management, Shahid beheshti University,Tehran,Iran Abstract The aim of this study is to identify and prioritize the key factors in selecting a target market in the food industry. In order to determine the components and subcomponents of this study, we have used previous researches in this area. In order to match these factors with the food industry situation and create a hierarchical structure, we have obtained the opinions of 323 experts about affecting factors on choosing a market in this industry with the use of questionnaire. Then, using a combination of hierarchal analysis process and Monte Carlo simulation and cooperation with 10 senior executives of distribution companies, the weight of each component and sub-component was determined. In general, four components and ten sub-components......

Words: 3589 - Pages: 15

Free Essay

A Stochastic Model for Order Book Dynamics

...INFORMS A Stochastic Model for Order Book Dynamics Rama Cont Department of Industrial Engineering and Operations Research, Columbia University, New York, New York 10027, Sasha Stoikov Cornell Financial Engineering Manhattan, New York, New York 10004, Rishi Talreja Department of Industrial Engineering and Operations Research, Columbia University, New York, New York 10027, We propose a continuous-time stochastic model for the dynamics of a limit order book. The model strikes a balance between three desirable features: it can be estimated easily from data, it captures key empirical properties of order book dynamics, and its analytical tractability allows for fast computation of various quantities of interest without resorting to simulation. We describe a simple parameter estimation procedure based on high-frequency observations of the order book and illustrate the results on data from the Tokyo Stock Exchange. Using simple matrix computations and Laplace transform methods, we are able to efficiently compute probabilities of various events, conditional on the state of the order book: an increase in the midprice, execution of an order at the bid before the ask quote moves, and execution of both a buy and a sell order at the best quotes before the price moves. Using high-frequency data, we show that our model can effectively capture the short-term dynamics of a limit order book. We also evaluate the......

Words: 11360 - Pages: 46

Premium Essay

Monte Carlo Analysis

...Monte Carlo Statistical Analysis Name Course Instructor Date The Monte Carlo method is a mathematical method used for problem solving through the generation of random numbers and then observing a fraction of these numbers and the properties they obey. It is useful in obtaining numerical solutions to problems that are too complicated for analytical solutions. It is a form of probability used to understand the impact of risk and uncertainty in various areas such as financial and cost forecasting. It involves computation of the likelihood of given events occurring or not occurring, without taking into account the interaction of the elements involved in influencing the occurrence. The mathematical method was invented by Stanislaw Ulam in 1946 and named by Nicholas Metropolis after a classy gambling resort in Monaco, where a relative of Ulam frequently gambled [ (Fishman, 1996) ]. Concepts of the Monte Carlo method Uncertainty Being a forecasting model, there are assumptions that need to be made due to the uncertainty of various factors. One therefore needs to be able to make estimations of the expected results as they cannot predict with certainty what the end value will be. Important factors such as historical data and past experiences in the field can be helpful in making an accurate estimate. Estimation In some cases, estimation may be possible but in others it is not. In situations where estimation is possible, it is wise to use a wide range of possible values......

Words: 2486 - Pages: 10

Premium Essay

Abc Monte Carlo

...Company Analysis: Monte Carlo Overview of Indian Economy According to National Council of Applied Economic Research (NCAER) the fourth largest economy of the world, i.e. India is expected a growth rate of 5.1% to 5.5% in real GDP in 2015. Moreover Technopak Report 2014 says, textile and apparel industry has been a major contributor to India’s GDP from last two decades, providing employment to more than 45M people. This sector has also contributed towards the growth of industrial production and foreign exchange through exports. Textile and Apparel Industry In developing countries like India, higher annual GDP growth corresponds to increase in purchasing power of the consumers, favouring the growth in textile and apparel industry. But in developed countries USA, Japan and countries of European Union slower annual GDP growth corresponds to reducing the demand for textile and apparel. Cheap labour in developing countries accounts well for their production advantage. The size if Indian textile and apparel industry has increased substantially from US $70 billion in 2006 to US $90 billion in 2013. (Source: Technopak Report 2014) Overview Monte Carlo was launched in 1984 as an exclusive woollen brand, since then it has been a leading apparel brand in India in terms of revenue. Monte Carlo has successfully established as a Superbrand in each section consumers, viz. Men, Women and Kids. It primarily caters to premium and mid-premium segments among the above 3 consumer......

Words: 373 - Pages: 2

Free Essay

Book Review "World Order"

...Henry Kissinger’s World Order asks, if today’s leaders can rise above their own definition of world “order”, to achieve peace and global stability. Especially when the “balance of power” is constantly threatened by anarchy and chaos. The reason Kissinger, makes this his core enquiry, is because it addresses a challenge that the human race faces today, one that it might fear the most- a total global chaos. Kissinger uses conflict between different nations as the premise to his argument. He does so by looking at the historical experience of different civilizations, even going back to the Dark Ages, as suggested by the subheading of the book. The author begins by defining World Order as “an inexorably expanding cooperative order of states observing common rules and norms, embracing liberal economic systems, forswearing territorial conquest, respecting national sovereignty and adopting participatory and democratic systems of governance”. But in the introduction, the author also lets us know that “No truly global 'world power' has ever existed”. And what is considered to be the 21st century world order, is just a treaty which was devised in western Europe, without taking into consideration, the other countries and civilisations. Towards the end, Kissinger remarks that the leitmotif of our age is science and technology. With countries making huge advances in technology, they consider the security dilemma, before looking at the zero (sum) game analysis. Technology could thus......

Words: 1336 - Pages: 6

Premium Essay

Monte Carlo Simulation

...Monte Carlo Simulation The Monte Carlo Simulation encompasses “any technique of statistical sampling employed to approximate solutions to quantitative problems” (Monte Carlo Method, 2005). The Monte Carlo method simulates the full system many times, each randomly choosing a value for each variable from its probability distribution. The outcome is a probability distribution of the overall value of the system calculated through the iterations of the model. A standard approach to risk management of projects is outline by Project Management Institute (2004) that includes six processes: Risk Management Planning, Risk Identification, Risk Qualification, Risk Quantification, Risk Response Planning, and Risk Monitoring and Control. Monte Carlo is usually listed as a method to use during the Risk Quantification process to better quantify the risks to the project manager is able to justify a schedule reserve, budget reserve, or both to deal with issues that could adversely affect the project. Monte Carlo simulation, while not widely used in project management, does get some exposure through certain project management practices. This is primarily in the areas of cost and time management to quantify the risk level of a projects budget or planned completion date. In time management, Monte Carlo simulation may be applied to project schedules to quantify the confidence the project manager should have in the target competition date or total project duration. In cost management, the......

Words: 976 - Pages: 4

Premium Essay

Using Monte Carlo Tool for Risk Assessment

...Using Monte Carlo Tool for Risk Assessment CMGT/442 March 21, 2016 Craig McCormick Using Monte Carlo Tool for Risk Assessment A project can have many variables that can prevent it from completion. No one variable can effect a project more than a project’s risks. The key to having a successful completion of a project is through a risk assessment. It is the project manager’s job to identify potential risks within a project. Identifying these uncertainties will help to minimize the risks and their impact on the project. The Monte Carlo tool can be an asset for a project manager and risk assessment process. What is Monte Carlo? Monte Carlo is a simulation of mathematical technique that analyzes risk for decision making. The simulation uses different choices of action and gives a variety of probabilities and possible outcomes based on those actions. These possible outcomes are given in the most extreme situations, as well as with minor decisions. Additionally, the Monte Carlo simulation provides possible consequences of conservative decisions. Overall, “Monte Carlo analysis involves determining the impact of the identified risks by running simulations to identify the range of possible outcomes for a number of scenarios.” (Marom, 2010) How Monte Carlo Works Project risks are one of the big unknowns when it comes to risk assessment. Monte Carlo attempts to change these unknowns by using probability distributions. Probability distributions show that each risk variable...

Words: 444 - Pages: 2

Free Essay

Methos of Carlo

...mimicked as accurately as possible using a computer or in which computer models are set up to provide well - behaved experimental systems are increasingly providing a bridge between theory and experiment, for instance; the Monte Carlo method (MC) and the molecular-dynamics method (MD). In Monte Carlo method the exact dynamical behavior of a system is replaced by a stochastic process, whereas the MD methods are based on a simpler principle and consists of solving a system of Newton's equations for an N-body system. Stochastic simulation is some times called MC simulation (simulation is a numerical technique for conducting experiment on a digital computer, which involves certain types of mathematical and logical models that describe the behavior of the system over extended period of real time). The generally accepted birth date of the MC method is 1949, when an article entitled "The Monte Carlo Method" appeared, the American mathematicians J.Neyman and S.Ulam are considered to be its originator. The first successful application of this method to a problem of statistical thermodynamics dates back only to 1953, when Metropolis and co-workers studied "fluid" consisting of hard disks. In the nineteenth and early twentieth centuries, statistical problems were sometimes solved with the help of random selections, that is, in fact, by the MC method. Prior to the appearance of electronic computers, this method was not widely applicable since the simulation of random quantities by hand......

Words: 372 - Pages: 2