Stock market simulation with ambient variables and multiple agents



Similar documents
Answers to Concepts in Review

Online Appendix: Payoff Diagrams for Futures and Options

Trading Tutorial. Microstructure 2 Liquidity. Rotman School of Management Page 1 of 9

A Simple Model for Intra-day Trading

Understanding Margins

PDS TRADER MANUAL. Instructions for using the Payday Stocks Trader software Quantum Trading Technologies. PDS Trader Manual 1

Understanding Margins. Frequently asked questions on margins as applicable for transactions on Cash and Derivatives segments of NSE and BSE

Buying Call or Long Call. Unlimited Profit Potential

FIN FINANCIAL INSTRUMENTS SPRING Options

Hedging. An Undergraduate Introduction to Financial Mathematics. J. Robert Buchanan. J. Robert Buchanan Hedging

INFORMATION TO CLIENTS REGARDING THE CHARACTERISTICS OF, AND RISKS ASSOCIATED WITH FINANCIAL INSTRUMENTS (SHARES, SHARE-RELATED INSTRUMENTS AND BONDS)

Lecture 23: Pairs Trading Steven Skiena. skiena

Trading Intra-Day is All About Finding an Edge (May 2008)

I.e., the return per dollar from investing in the shares from time 0 to time 1,

General Forex Glossary

Two-State Options. John Norstad. January 12, 1999 Updated: November 3, 2011.

Market Microstructure: An Interactive Exercise

For example, someone paid $3.67 per share (or $367 plus fees total) for the right to buy 100 shares of IBM for $180 on or before November 18, 2011

Short Selling Tutorial

2. How is a fund manager motivated to behave with this type of renumeration package?

A stock is a share in the ownership of a company. Stock represents a claim on the company s assets and earnings.

HOW TO SELL A STOCK BY KELLY GREEN

Finance 400 A. Penati - G. Pennacchi Market Micro-Structure: Notes on the Kyle Model

How to Win the Stock Market Game

BEAR: A person who believes that the price of a particular security or the market as a whole will go lower.

THE CDS AND THE GOVERNMENT BONDS MARKETS AFTER THE LAST FINANCIAL CRISIS. The CDS and the Government Bonds Markets after the Last Financial Crisis

CENTRE FOR INVESTMENT EDUCATION AND LEARNING. Author 1 & Author 2. Location - Date

Options. Moty Katzman. September 19, 2014

Derivatives: Options

Stock Market Game Test

FIN FINANCIAL INSTRUMENTS SPRING 2008

Session X: Lecturer: Dr. Jose Olmo. Module: Economics of Financial Markets. MSc. Financial Economics. Department of Economics, City University, London

Trading Dashboard Tutorial

FINANCIAL ENGINEERING CLUB TRADING 101

Investment Analysis (FIN 383) Fall Homework 2

Problem Set 1 Foundations of Financial Markets Instructor: Erin Smith Summer 2011 Due date: Beginning of class, May 31

BUSM 411: Derivatives and Fixed Income

Lecture 12. Options Strategies

Financial Market Microstructure Theory

Investment Analysis (FIN 670) Fall Homework 2

Math 194 Introduction to the Mathematics of Finance Winter 2001

THE POWER OF FOREX OPTIONS

SUMMARY BEST INTEREST AND ORDER EXECUTION POLICY

SUMMARY BEST INTEREST AND ORDER EXECUTION POLICY

THE EQUITY OPTIONS STRATEGY GUIDE

Put and Call Options

Momentum Traders in the Housing Market: Survey Evidence and a Search Model

14 Greeks Letters and Hedging

NOVEMBER 2010 VOLATILITY AS AN ASSET CLASS

Momentum traders in the housing market: survey evidence and a search model. Monika Piazzesi and Martin Schneider

Options Strategies. 26 proven options strategies

Factors Affecting Option Prices

Day Trade Warrior. Business Plan Trading as a Business

Disclosure on risks relating to Online Trading

Research Paper No. 44: How short-selling activity affects liquidity of the Hong Kong stock market. 17 April 2009

High-frequency trading: towards capital market efficiency, or a step too far?

TMX TRADING SIMULATOR QUICK GUIDE. Reshaping Canada s Equities Trading Landscape

How to Screen for Winning Stocks

Algorithmic Trading Session 1 Introduction. Oliver Steinki, CFA, FRM

Copyright 2009 by National Stock Exchange of India Ltd. (NSE) Exchange Plaza, Bandra Kurla Complex, Bandra (East), Mumbai INDIA

2. Exercising the option - buying or selling asset by using option. 3. Strike (or exercise) price - price at which asset may be bought or sold

tutorial

Trading CFDs with Trader Dealer ABN (AFSL NO )

Turk s ES ZigZag Day Trading Strategy

Welcome to FOREX e-book

VALUING BANKING STOCKS

What is a share? Course 1

Investor Performance in ASX shares; contrasting individual investors to foreign and domestic. institutions. 1

A Beginner s Guide to the Stock Market

What is Equity Linked Note

Investor Guide ALL YOU NEED TO KNOW. (Vol: II)

Security Bank Treasury FX and Rates Hedging Division Gearing Up for External Competitiveness November 19, Treasury FXRH

Best Online Trading Platform Saudi Arabia

Session IX: Lecturer: Dr. Jose Olmo. Module: Economics of Financial Markets. MSc. Financial Economics

Client Software Feature Guide

Exchange Traded Funds. Plain Talk Library

FACTORS TO CONSIDER IN PERFORMING A VALUATION ANALYSIS FOR A FAIRNESS OPINION

Market Efficiency: Definitions and Tests. Aswath Damodaran

Investments, Chapter 4

Guide to Options Trading. NZX Derivatives Market

PUREDMA TRADING MANUAL

Chapter 3.4. Forex Options

No duplication of transmission of the material included within except with express written permission from the author.

Options Strategy for Professional Clients

Volatility Trade Design

FUNDING INVESTMENTS FINANCE 738, Spring 2008, Prof. Musto Class 4 Market Making

Underlier Filters Category Data Field Description

OPTIONS EDUCATION GLOBAL

XIV. Additional risk information on forward transactions in CFDs

Overlapping ETF: Pair trading between two gold stocks

Example 1. Consider the following two portfolios: 2. Buy one c(s(t), 20, τ, r) and sell one c(s(t), 10, τ, r).

Basic Strategies for Managing U.S. Dollar/Brazilian Real Exchange Rate Risk for Dollar-Denominated Investors. By Ira G. Kawaller Updated May 2003

COOLTRADE PERFROMANCE TIPS By Regina Guinn. Here are some things that subscribers should be aware of when running an automated trading platform.

A Simulation Model for Studying the Influence of Algorithmic Trading and. Vending Machines on the State of the Stock Market

6. Foreign Currency Options

Using The Stock Market Game (SMG)

Four of the precomputed option rankings are based on implied volatility. Two are based on statistical (historical) volatility :

InvestorsFriend.com. Trading Strategies For Longer Term Investors

Transcription:

Stock market simulation with ambient variables and multiple agents Paolo Giani Cei 0. General purposes The aim is representing a realistic scenario as a background of a complete and consistent stock market. Changes in endogenous and exogenous variables shall lead to a very wide range of outputs, and opposite likelihood judgments. 1. The world that we aim at reproducing Stock markets are nowadays artificial worlds that reproduce electronically the bargaining processes for any kind of security. Stock markets are strictly regulated with common worldwide rules, in order to minimise uncertainty for the investors. The basic activity is the exchange (BUY/SELL). Each operator interested in opening (closing) a position can insert a BUY (SELL) order. Generally, every buyer (seller) has clear in mind the max (min) price at which he could be willing to buy (sell). Hence, when the buy/sell instruction is given, the operator declares this max/min price: the max price that the purchaser is willing to pay is called bid price; the min price that the seller is willing to accept is called the ask price. The electronic market collects all the bid/ask orders and ranks them quantitatively. An exchange is performed when buyer and seller reach an agreement about the price, i.e. when the bid/ask spread comes to be equal to zero: in any case, the market ensure that every buyer pays the seller with the lowest bid price, and every seller can sell to the buyer with the highest ask price (because in the real word, nobody might choose differently!). The last performed contract displays the last price, i.e. the official market price: an operator may also insert a market order, without a bid/ask limit price, and perform the exchange immediately at the market price (or slightly less or better). That is really true in liquid markets, with

huge daily volumes, while it could be inefficient for securities which do not enjoy a continuous flows of exchange orders. Now, it is clear that the agents buy and sell with the goal of a profit: this can be reached simply by holding a security and trusting in long-run positive returns, taking also into account dividends. The short-run approach is instead the one of speculators, i.e. agents who believe that they have real possibilities to perform better than the market, and they use their skills in order to beat the market. let us be concerned only with speculators, i.e. people entering the market when they presume that prices will rise, and exiting before the alleged drop. This is the standard approach, the bull one, based on the strategy of exploiting price rises. The complementary speculative approach is the bear one, which makes profit when the chosen security falls in price, since it has been previously short bought and it will be short sold.

2. Netlogo settings In this model, all kinds of agents are contained in just one breed, randomagents. Behavioural differences are set throughout sliders, which always represent probabilities that the group of randomagents may operate following different rules. The greater feature of this model is the creation of a consistent and realistic world: before running the program, the user can set the fundamental economics of the exogenous scenario, and in particular: population size level of general uncertainty in the system agents' expectations rate real economy growth rate dividend pay-off rate agents' investment propensity out of market level It is straightforward to argue that each one of this parameters strongly affects stock market trend. The first and the second ones affect market liquidity, i. e. the ration between performed transactions and market intentions. The following variables (but the last) all show a positive relationship with stock prices. Interesting results can be obtained by setting a negative situation in one context and a positive in another one, and checking which one will prevail. Out of market level is an operational variable representing the speed at which the agents exit the market when prices and money levels are dramatically low. As to the sliders about agents' mind, we have: the ratio between moving average investors and the rest of the population followed by the length for the moving average list the ratio between periodic agents and the rest of the population followed by the length of the holding/waiting period As we said, these sliders represent probabilities. In the next section we will examine the code. Moving average agents are technical analyst who follow a simple rule: when the last price is lower than the historical price, then buy: and vice versa. The length of the period taken into account is the number of days used to calculate the moving average. Periodic agents are speculators who use their own criteria in order to buy-sell: as a simplicity

scheme, here we have that PA buy/sell at the end of a fixed span of time (holding/waiting period), in which they pretend to realise a profit or minimise losses. With the go button, an open market day is run. At the end of each tick, in the display are shown all market levels and every agents has set his colour in order to describe what he has done: a dark gray means that he stayed put because of uncertainty a light gray colour means that he asked for a price without finding a counterpart (then he passed) a red colour means that he sold a green colour means that he bought Finally, a link is visible between each buyer/seller and his counterpart.

3. Code building blocks Let us be concerned now with the fundamental strings of the model. If the agent is not out of market, each day he receive an increment in terms of money in his pockets, because of economy expansion (notice that, if economy goes well, shareholders also receive dividends!); in case of contraction, money in his pockets shrinks. Then, the agent faces to the probability to be a periodic agent. If not, he has to face the probability to be a moving average agent. Finally, if he is a normal agent, the buy/sell intention is set by a random-float (again, a probability) which depends strictly on expectations rate and investment propensity: notice that, in previous case, these two features does not affect agents' behaviours, since technical analyst and periodic agents are supposed to operate on the basis of their own beliefs.

In this section, each agent offers a price, which will be put, in the next section, in the bid/ask book. The two last conditions ensure that nobody can sell if he does not hold at least one stock, and nobody can buy paying a price higher than his savings. In this section, the most pregnant feature: bid/ask book is formed. LogB collects all bid offers, LogS ask ones. Then books are sorted increasingly. Then, prices are paired following market rules: the exeprice is always the lower one in the list, because nobody would buy at a price higher than the lowest one, and vice versa. When bid/ask price find a counterpart, exchange is performed.

4. Experiments and results. Different situations in this model are really easy to be painted. 1. Standard (neutral) economic conditions lead to a random and stable stock market trend: 2. If we increase MA elements (say, 20% with MA length 90 days), a regularity has born: 3. The period of the regularity obviously depends on the length of the MAlist: if we increase that value to about 300 days:

4. The magnitude of oscillations obviously depends on the percentage of MA agents in the model: ceteris paribus, if we reduce this value to 10%: 5. But, if MA elements are too many, liquidity drops and eventually exchanges come to be impossible, simply because book intentions are the same for all the agents, without any chance of finding a counterpart.

6. Keeping 20% of MA agents (with 300 days of MA list), let us be concerned with shocks in real economy. First of all, a jump in expectations will lead stock prices to the sky, but then we will see a new stable trend: 7. Again, if expectations are too high liquidity will drop and exchange will become impossible, simply because everybody wants to buy and nobody wants to sell! Let us see the result with exp rate 100%: 8. A drop in investment propensity (a concurrence hard to be verified in real world, but useful to theoretical survey) produces and interesting non-regular trend, even if MA elements are still present... that means that, in this case, exogenous variables have greater influence on stock market than endogenous ones.

9. Let us clear all: if we set 30% MA elements (with 300 days) and 30% periodic elements (with holding period 21 days), we can notice that the competition between the two groups originates a spurious regularity, i.e. a periodic trend which is constantly interrupted at fixed moments (notice also liquidity peaks and drops!) Obviously, magnitudes and period lengths depend on the parameters of the single agents. 10. Notice now that the occurrence of organised groups generally reduces the liquidity of the sistem: let us set 50% MA elements and 50% periodic agents. We can see that the trend comes to be really electric, i.e. the contrast between the two forces increases volatility. Nevertheless, the stronger this contrast, the weaker is liquidity

11. Finally, let us be concerned with consequences of negative business cycles: suppose economy is in strong recession (suppose, extremely, -18% per year!), but suppose that investment propensity and expectations are still high. The result is that investors are poor in terms of money in their pockets, but everybody still wants to buy: hence, stock prices are still high, and nobody can afford this expence... then, market is empty!