UNIVERSITY COLLEGE LONDON
DEPARTMENT OF COMPUTER SCIENCE
Prediction Market: A Study of Future Country Interest
And The Market Behavior
Author: Xueyi Jiang (1037053)
MSc Financial Computing Project 2010/2011
Project Supervisors: Chris Clack, Michael Mainelli
This report is submitted as part requirement for the MSc Degree in Financial Computing at
University College London. It is substantially the result of my own work except where
explicitly indicated in the text. The report will be distributed to the internal and external
examiners, but thereafter may not be copied or distributed except with permission from the
project host organisation.
ABSTRACT
Prediction markets have proven high forecasting performance in many fields such as politics,
sports and business-related fields compared to traditional methods such as polls or expert
opinions. A web-based trading platform with a set of continuous double auction prediction
markets, called ExtZy will be studied for testing ideas on the causal connection between
future country interest and market behaviour. The market data collected during this study will
be statistically analyzed in order to explain how market response to information in reality in
prediction markets. Methods like technical analysis and the hypothesis testing methodology
will be applied to understand traders’ behaviour in prediction markets. The empirical
evidence shows that the market price in ExtZy implied relatively high prediction accuracy in
predicting country interest by the collective wisdom of traders. ExtZy indeed can be used to
predict search trends and spikes in some cases.
ACKNOWLEDGEMENTS
This section acknowledges people without whose help and supporting, none of the current
work would have been feasible.
Firstly, I would like to express my thanks and appreciation to my supervisor Prof. Michael
Mainelli, for his huge encouragement and guidance, and my colleague in Z/yen, Ben Morris,
for his continuous patience and assistance. Whenever the problems came, they always gave
the right direction and encourage me to solve it. That improved my research skills greatly and
was really helpful in my further study. I need as well to appreciate my academic supervisor
Dr. Chris Clack’s significant suggestions and help.
Specially, my appreciation goes to my dear parents. They gave me the chance to study
abroad, and this experience would be greatly valuable in my whole life. Without their love
and help, I would have no courage to face the troubles in study and life at all.
Without the understanding and love of these people, I would not have thought it possible to
complete a research project such as this one. They always offer me a helping hand whenever
they see me in the struggle.
CONTENTS
1.
2.
Introduction ....................................................................................................................... 1
1.1
Motivation ........................................................................................................................1
1.2
Aims and Objectives .........................................................................................................3
1.2.1
Technical Objectives ............................................................................................................................ 3
1.2.2
Experimental Objectives ..................................................................................................................... 3
1.3
Research Questions ..........................................................................................................4
1.4
Project Scope and Limitation ...........................................................................................4
1.5
Methodology.....................................................................................................................5
1.6
Report Structure ...............................................................................................................6
Literature Review............................................................................................................... 7
2.1
Stock Markets ..................................................................................................................7
2.2
Prediction Markets ..........................................................................................................9
2.2.1
How Prediction Markets Work? ....................................................................................................... 9
2.2.2
Accuracy of Prediction Markets ..................................................................................................... 10
2.2.3
Benefits of Prediction Markets ........................................................................................................ 11
2.2.4
Empirical Findings of Prediction Markets ................................................................................... 12
3.
4.
Market Analysis and Requirement Gathering............................................................... 13
3.1
Market Description .......................................................................................................13
3.2
Market Design ...............................................................................................................14
3.3
Account Basics ..............................................................................................................15
3.4
Contract Design ............................................................................................................16
3.5
Trading Rules ................................................................................................................17
3.6
Market Information .......................................................................................................17
Data Analysis and Empirical Results.............................................................................. 18
4.1
Data Classification........................................................................................................18
4.2
Methodology..................................................................................................................19
4.3
Initial Data Collection ..................................................................................................20
4.4
4.3.1
Market Price and Trade Volume ...................................................................................... 20
4.3.2
Future Interest.................................................................................................................. 21
4.3.3
Market Volatility............................................................................................................... 22
4.3.4
Supply and Demand Distribution ..................................................................................... 23
4.3.5
Prediction Accuracy ......................................................................................................... 23
Data Preparation ..........................................................................................................24
4.4.1
Dividend ........................................................................................................................... 24
4.4.2
Price-Earning Ratio ......................................................................................................... 25
4.4.3
Historical Volatility .......................................................................................................... 26
4.4.4
Pricing Options and Black-Scholes Formula................................................................... 27
4.5
5.
6.
Empirical Results and Analysis.....................................................................................28
4.5.1
General Observations....................................................................................................... 28
4.5.2
Prediction Accuracy ......................................................................................................... 29
4.5.3
Empirical Analysis ........................................................................................................... 31
4.5.4
Conclusions on Analysis Results ...................................................................................... 47
Implementation and Test ................................................................................................. 49
5.1
Requirements Gathering ...............................................................................................49
5.2
Database Architecture ..................................................................................................50
5.3
Development Environment ............................................................................................51
5.3
Webpage Implementation..............................................................................................52
5.4
Testing ...........................................................................................................................60
5.5
Validation......................................................................................................................61
Summary and Conclusions.............................................................................................. 63
APPENDIX A
System Manual.................................................................................... 66
APPENDIX B
Gantt Chart ......................................................................................... 72
APPENDIX C
Data Pre-Processing Query ................................................................ 72
APPENDIX D
Empirical Results................................................................................ 74
APPENDIX E
Code ListS ........................................................................................... 75
BIBLIOGRAPHY
List of Figures
Figure 2.1 Investment Procedures............................................................................................. 7
Figure 4.1 Google Trends........................................................................................................ 21
Figure 4.2 Price-Earning Ratio and Trade Volume: Libya .................................................... 31
Figure 4.3 Price-Earning Ratio and Trade Price: Libya ........................................................ 32
Figure 4.4 Supply and Demand Distribution: Libya .............................................................. 33
Figure 4.5 Moving 1-Week Historical Volatility: Libya.......................................................... 34
Figure 4.6 Price-Earning Ratio and Trade Volume: Spain .................................................... 35
Figure 4.7 Price-Earning Ratio and Trade Price: Spain ........................................................ 36
Figure 4.8 Supply and Demand Distribution: Spain ............................................................... 37
Figure 4.9 Moving 1-Week Historical Volatility: Spain.......................................................... 37
Figure 4.10 Price-Earning Ratio and Trade Volume: Japan.................................................. 39
Figure 4.11 Price-Earning Ratio and Trade Price: Japan ..................................................... 40
Figure 4.12 Supply and Demand Distribution: Japan ............................................................ 40
Figure 4.13 Moving 1-Week Historical Volatility: Japan ....................................................... 41
Figure 4.14 Price-Earning Ratio and Trade Volume: Korea North ....................................... 42
Figure 4.15 Price-Earning Ratio and Trade Price: Korean North......................................... 42
Figure 4.17 Price-Earning Ratio and Trade Volume: United States ...................................... 44
Figure 4.18 Price-Earning Ratio and Trade Price: United States.......................................... 45
Figure 4.19 Supply and Demand Distribution: United States................................................. 45
Figure 4.20 Moving 1-Week Historical Volatility: United States ........................................... 56
Figure 5.1 Entity Relationship Diagrams................................................................................ 51
Figure 5.2 Transaction History Page 1................................................................................... 53
Figure 5.3 Transaction History Page 2................................................................................... 55
Figure 5.4 Entity Data............................................................................................................. 56
Figure 5.5 Transaction History Page 3................................................................................... 56
Figure 5.6 Transaction History Page 4 .................................................................................. 56
Figure 5.7 Countries Volatility ............................................................................................... 57
Figure 5.8 Countries Market Index ......................................................................................... 57
Figure 5.9 Estimated call and put option price of Japan (30 days to expiration) .................. 58
Figure 5.10 Estimated call and put option price of Japan (180 days to expiration) .............. 59
Figure 5.10 Transaction History Page (playerID=3184356239164844 and Days=500) ...... 61
Figure 5.11 Query Result (Transaction History) .................................................................... 62
Figure 5.12 Historical Volatility Chart in Excel ..................................................................... 62
List of Tables
Table 4.1 Data Classification .................................................................................................. 18
Table 4.2 General Observations on ExtZy .............................................................................. 28
Table 4.3 Prediction Accuracy of Trade Price ....................................................................... 30
CHAPTER 1 --INTRODUCTION
This section gives an overview of this project, which derives from the proposed research
project (ExtZy) supported by a financial risk management organization (Z/Yen Group). Aims
and objectives of the project will also be described, and a brief overview of the organization
of the report will be given.
1.1
Motivation
Forecasting is the most difficult part in any science fields, the greatest challenge to human
wisdom, but also what we are most in need of. Many people devoted their whole life
to "predict" one thing, such as if the financial crisis will occur in Asia, if the swine flu will
spread in the world, if the earthquake will occur at a specific time or place, etc. All these
things may bring about a very far-reaching effect on human development and even threaten
the basic human right for survival. “Prediction Markets” provides us an unprecedented,
powerful and immediate mechanism to make it easier for us to master the future world.
Traditionally, the so-called "prediction" is always based on the opinions or judgements of
some experts and involves a lengthy process, but not necessarily with the accurate judgments
or better results. In particular, in the era of information explosion, how do we select the
useful comments or judgments is a more difficult problem. In other words, we need a more
effective mechanism to exchange the whole variety of useful information and concentrate the
wisdom of collectivity to predict future events [1].
1
Till now, we often research public opinion and forecast specific events’ (i.e. election, sports
game) results through traditional polls. However, the survey results are not necessarily
accurate and continuous, but always expensive. “Prediction markets” can provide a low-cost
and efficient mechanism to explore public opinion, which is far more reliable and accurate
than the traditional methods.
Economically, it is nowadays a general notion that large amounts of capital are traded
through stock market. The common characteristic of all stock markets is their uncertainty [1],
which is relevant to their future states. This uncertainty is not desirable for investors but also
inevitable whenever the stock market is chosen as the investment tool. The best that can be
done is to try to minimize this uncertainty. As stated previously, “Prediction Markets” can be
one of the instruments to play a key role in this process.
2
1.2
Aims and Objectives
In the past decades, there is an increasing interest in prediction markets among economists,
policymakers, academics and market makers. This project derives from the proposed research
project (ExtZy) supported by a financial risk management organization (Z/Yen Group). The
overall aim of this study is to attempt to evaluate ExtZy, as a prediction market, whether or
not can help to predict future country interest.
1.2.1
Technical Objectives
This chapter discusses some of the objectives that the system should achieve. Most technical
objectives are implemented with Python. The system must allow the user to access a list of
historical transactions. The system must have output of charts and tables for fundamental data
of each entity. The system must provide an instantaneous visualization of the market index.
The system must allow the user to calculate the estimated option price of counties entity
based on the historical volatility.
1.2.2
Experimental Objectives
On the basis of analyzing and utilizing the existent ExtZy system, the first objective of the
study is to examine the feasibility of the prediction task and provide evidence that the ExtZy
are not fluctuating randomly. The second objective is, by querying the data, building dynamic
WebPages and analyzing most typical cases to generalize its prediction accuracy.
3
1.3
Research Questions
The following research questions allow the research to meet the objectives mentioned before:
Q1: What is the relationship between share prices, dividend, P/E ratio and Google hits rate in
ExtZy?
Q2: How have players done in gauging what goes on in real world to make money in ExtZy?
Q3: How to estimate the historical volatility of the whole ExtZy countries market?
Q4: As a prediction market, can ExtZy accurately forecast the future country interest?
1.4
Project Scope and Limitation
This research is only for the countries market of ExtZy. The goal is to evaluate the accuracy
of the market outputs (or derived data from technical data) against the reality (data from
Google trends) and gain insights in the players’ behavior.
The limitation of this study is the availability of data. Z/Yen launched its prediction market
ExtZy on Apr 2009 and the newest dividends calculation was added to the raw dataset in Mar
2010, therefore the availability of data is significantly decreased. In this regards, it limits the
analysis and evaluation of ExtZy to only one year of data. However, this should not affect the
effectiveness of prediction market.
4
1.5
Methodology
The methodology used while conducting the research is as follows:
•
Conduct a literature review through books, papers and online resources on the topic of
prediction markets
•
•
•
•
•
Determine the data (sample countries) to be analysis on and what to forecast
o
Trade Price and Volume
o
P/E Ratio
o
Supply and Demand Structure
o
Volatility
Examine the trading behaviour against the reality with technical analysis
o
Assemble the historical input data and pre-process it using Microsoft Excel
o
Statistically compare market outputs vs. reality data
Modelling Volatility on ExtZy
o
Look at the past trading behaviour and calculate historical volatility
o
Build a dynamic webpage in Python language to present the market volatility
o
Statistically compare webpage outputs vs. reality
Run “prediction markets” on the results of ExtZy
o
Identify the mathematical theory behind the Black-Scholes Model
o
Build a webpage for calculating the option price for each ExtZy countries entity
Evaluate the forecasting accuracy of ExtZy with above four indictors and draw a
conclusion on whether or not ExtZy can predict future country interest
5
1.6
Report Structure
The complementation of the aims and objectives of this project as described earlier take place
throughout six chapters. Here we present a brief of the content of each chapter:
Chapter2 will give detail background information on stock market and prediction market.
Chapter3 will contain a description of the prediction market design in order to obtain data
for further analysis.
Chapter4 will explain the selection of data for the evaluation of prediction accuracy and the
mathematical theory behind these data. This chapter will present the empirical analysis and
tests the hypotheses regarding the influence of information on the market behaviour and
prediction accuracy.
Chapter 5 will present the further implementation and testing on system for exploring
previously presented analysis.
Chapter 6 will draw a critically conclusion on the project objectives of this study, point out
the limitations and provides some plans for further developments.
6
CHAPTER 2 --LITERATURE REVIEW
This chapter gives detailed background information from literatures to stock markets and
prediction markets. The first section will give detailed explanations on two major investment
theories in stock markets. And the second section will explain the need to manage intraday
day liquidity; liquidity requirements for banks.
3.1
Stock Markets
There is no doubt that most people are trying to achieve profits whenever they involved in the
stock markets. Profit may come by investing in stocks that have a good future (short or long
term future). Thus what they are trying to accomplish is to predict the future of the market.
But what determines this future exactly? The way that people invest their money is the
answer and people invest money based on the information they hold [1]. Therefore we have
the following schema:
Information
Investors
Figure 2.1
Market Level
Investment Procedure
According to this schema (Figure 2.1), the factors that need to be take into consideration are:
•
The content of the ‘Information’ component
•
The reaction of the ‘Investor’ when having this information.
7 Traditionally, the investment community accepts two major investment theories: the Firm
Foundation and the Castles in the Air. With reference to these theories, it allows us to
understand how the market is shaped, or in other words, how the investors think and react. It
is this sequence of ‘thought and reaction’ by the investors that defines the capital allocation
and thus the level of the market [1].
According to the Firm Foundation theory, it postulates that the reaction of the investors is
triggered by information that is related to the intrinsic value of firms [2]. And this value is
determined by a comprehensive analysis of current situations and future prospects of a
company.
As for the Castles in the Air theory, the investors are influenced by information that is related
with other investors’ behaviour [3]. The only concern for this theory is that the investor
should have is to buy today with a lower price and sell tomorrow with a higher one, no matter
what the intrinsic value is.
Therefore, the former theory prefers the view that the stock markets are defined mostly by
logic, while the latter one supports that the markets are depended mostly on psychology.
8 3.1
Prediction Markets
This chapter presents detailed background information to prediction markets and summarizes
related apocalypse based on the former research literatures.
2.1
How Prediction Markets Work?
Prediction markets works similar to stock exchanges. In prediction markets, a “stock” is often
established to reflect an interesting topic to the company such as the product sales, the
feasibility of new services or products, and other in-depth understandings of employees. In
this way, employees participate as “traders” based on their perceptions of future trends.
Traders are inspired to obtain relevant information and contribute their best assessments.
Traders buy or sell shares of the stock in accordance with their confidence on future
occurrences and wish to accumulate their portfolio value. When a trader, for instance, notes
that the share price is higher (or lower) than his expected value associate with the issue, he
will sell (or buy) the stock, and hence the decreased (increased) price.
As the result of this volatile, the stock price in prediction market can be considered as a
continuous real-time indication of future results relevant to the issue being raised. It also
constantly reflects collective evaluation of the future occurrences from employees in same
way that the trading of a firm’s stock on a stock exchange (Figure 2.1) constantly indicates
the aggregated assessment of the market level of the firm from traders.
9 2.2
Accuracy of Prediction Markets
Since the late 1980s, firstly at the Iowa Electronic Marketplace, prediction markets have been
started to investigate the accuracy of predictions of election outcomes derived from the
trading activity within the markets [5]. Existing evidence from Iowa Electronic Marketplace
shows that the political stock markets outperformed regular polls in most cases.
As the success of prediction markets in aggregating information about events’ results, some
other prediction markets have emerged to trade on events with either virtual or real money
[6]. Over the past several years, the Hollywood Stock Exchange almost perfectly predicted
the box office performance of Hollywood movies and the Oscar award winners, which has
beaten the average forecasts of experts and individuals [7].
Furthermore, research indicates that prediction markets for business forecasting can also
perform better than traditional methods. There is evidence that prediction markets on sales
forecasting were significantly better than official company forecasts [8]. Companies such as
Google, Yahoo, Microsoft and Hewlett-Packard are all running internal prediction markets to
tap the collective intelligence of people within their organizations.
10
2.3
Benefits of Prediction Markets
The basic idea of prediction markets is an electronic trading platform for virtual stocks whose
payoffs are determined by the outcomes of some uncertain future events [9]. Prediction
markets are also known as information markets, idea markets or decision markets [10]. As
the names suggest, prediction markets offer a unique means to unify various information and
market predictability within the enterprise.
A prediction market is often established within an organization to produce predictions on the
issues the company is interest in and settles the problem of internal communication
constraints directly. By this kind of approach, even for a geographically distributed
organization, prediction market can generate a virtual management environment by raising a
smart forum in order to improve the final analysis of intelligence and influence in its
interested fields [11].
In addition, prediction markets could lead to increased employee involvement and resources
levels through its collaborative feature and provide staffs a unified platform that their
intelligence to be taken seriously, while leveraging the possibility of receiving information
from all minds within the company for leaders [12].
11
2.4
Empirical Findings of Prediction Markets
The prediction of markets has been given to attention over the past few decades with its wide
deployment. Although the relevant evidence is still increasing in different areas, based on our
preliminary information from literatures, we can draw some conclusions as following:
i. The market price in prediction markets is an instant indicator of new information.
Efficient market hypothesis indicates that all relevant and available information about an
asset in a financial market is reflected in its market price [13].
ii. The prices time series seem correspond to the random walk model and the operations
based only on public information are not profitable [13].
iii. The forecasting accuracy of prediction market is generally higher than the other
forecasting methods, such as opinion polls or experts prediction.
iv. The behaviour such as market manipulation whose aims to change the stock price
deliberately by some technologies might lead to failure at last [14].
12
CHAPTER 3 --MARKET ANALYSIS
This chapter includes a analysis on the ExtZy markets and further experimental design of
ExtZy, which will be used to collect more data for empirical analysis for this research.
3.1
Market Description
A web-based trading platform with a set of continuous double auction prediction markets,
called ExtZy was studies for the aim of this research in order to analyse historic trading data
and test idea on prediction accuracy of individual traders and whole markets. Future interest
of countries (on politics, wars, sports…) was determined as the event to be predicted. There
are 245 different shares issued for trading in all and each share represents a country entity.
Participants are able to access to news on international affairs easily through all kinds of
means and media will give these affairs a lot of media coverage immediately. Therefore, it
may lead to a high number of participants and thus have obvious preferences for particular
country they bet on at a specific time so that indications of biases can be detected easily. This
is the reason why future country interest was chosen.
13
3.2
Market Design
The basic idea of ExtZy markets is similar to that of some prediction markets mentioned
before (in Chapter 2) such as the Yahoo! Tech Buzz Game, Iowa Electronic Markets, InTrade
and Hollywood Stock Exchange, etc. Though these public prediction markets designed their
markets in different ways and served for different functionalities, they all are attempting to
settle the same problem: how to attract more participants into these markets, and generate
significant predictions.
Like these markets, participants trade in ExtZy in order to make a profit. In addition, ExtZy is
also about to learn how markets work, the effect of popularity and perception on prices (or
other derived data), and the inspiration of exploring hidden value [14].
ExtZy markets allow participants to trade in shares whose underlying value is associated with
their popularity and earning dividends based on search volume at Google on a weekly basis.
To encourage participation, participants can exchange their earnings into real prizes. In
addition, different from InTrade and IEM, the payment in ExtZy is made by virtual money
instead of real money.
ExtZy Countries markets was launched on Apr 13th, 2009 and remained open for trade 24
hours 7 days until now. For each country entity, ExtZy issued 1000 shares when it started.
14
3.3
Account Basics
Each participant will be given a credit line of
1000.00 of Zoints (a virtual currency) after
registration by which he/she can buy or sell shares later. Each trader is able to get
instantaneous information about his account (with his assets value at current market prices), a
list of current holdings, current offers, registered entities, dividend history and transaction
history (Further Implementation will be shown in Chapter 5).
The system permits traders to view a list of all country shares with their last transaction price
and their current best available offer price. Traders are able to directly buy (sell) shares at
current price or make an offer to buy or sell at your own valuation in the respective markets
with other participants.
15
3.4
Contract Design
As mentioned in Chapter 3.1, the mechanism that matches buyers to seller is a continuous
double auction in ExtZy, which means that once reach a mutually agreeable price, a
transaction will occur. In this regards, a large volume of buy or sell orders will be
continuously submitted.
In addition, the clarity of contract is on the basis of two things: knowing how the dividend is
paid, and understanding the relation between searches and dividend. These concepts are
extremely simple, and one can even observe the historical search hits that represent a country.
Furthermore, ExtZy Countries will introduce option contracts. By applying Black-Scholes
model to prediction markets, traders are able to estimate prices of option that is at-the money
with different time to the expiration date. (Further Implementation will be discussed in
Chapter 5).
16
3.5
Trading rules
Traders are able to make an offer on an appropriate share by selecting the quantity of units
and the offer price. The trade processing system checked only the best available price but
ignored the following offers in the queue to make sure that the transaction is always be
agreed on a common price and minor quantity of both sides. The remaining quantity will be
made as a separate order then kept in the order queue.
There are not any charges or transaction fees in ExtZy. However, traders are only able to
place a buy order with a sufficient amount of free Zoints. With such rules, the system allows
traders to interpret easily that whether or not their holding contracts is more valuable than
some time before.
3.6
Market Information
All trades in ExtZy are anonymous which means that traders are not able to recognize the
identity of other marketers. Traders are provided continuously information and graphs about
past transaction prices, the volume of each transaction and even historical search hits
numbers of each share. Besides, information on a total of dividends paid, trade volume,
average price for last certain days are accessible for traders.
Furthermore, the daily updated market index and market volatility are demonstrated by
charts, which imply market participation and movements (Further Implementation will be
discussed in Chapter 5). The purpose of such charts is to increase market liquidity more or
less by making traders more clear about the general situations.
17
CHAPTER 4 --DATA ANALYSIS & EMPIRICAL RESULTS
This chapter presents the gathering, querying and analyzing of data in this study. The overall
aim is to analyze the data (derived data) from the ExtZy and evaluate the accuracy of the
market outputs against the reality in order to gain insights in the trader behaviour in real life.
4.1
Data Classification
The investigation about markets derived from the study on relevant data. Here we attempt to
describe and classify the data into three major groups that will be used in following study.
The following Table 4.1 gives a detail of the three categories of data:
Table 4.1 Data Classification
18
4.2
Methodology
The study of the prediction market has been always given to attention long time. Reference to
the previous literature there are a variety of methods have been applied to accomplish this
task. In the following study, we will mainly work with technical analysis method.
The basis of technical analysis is that the price movements of stocks are influenced by the
constantly changing attitudes of investors in response to a variety of market forces [19]. The
key belief of technical analyst is that the historical performance of stocks and markets are
important indicators of their future trends. By using data such as historical price series,
trading volume and other market data, future stock movements can be easily found. Although
this approach is very popular, there are some shortcomings have been severely criticized. The
main objection to this method is that the analysis of charts is highly subjective and thus
different analysts may hold different views on the same charts.
19
4.3
Initial Data Selection
As specified in Chapter 1.4, a new dividend calculation was introduced to the raw datasets on
Mar 5th 2010, through traders were able to make offers and transactions since Apr 13th 2009
in ExtZy Countries markets. For the effectiveness of information aggregation and market
evaluation, the more valid data includes, the more accuracy the prediction is. Therefore, we
will consider all the transactions and offers from May 1st 2010 to Aug 1st 2011 (15 months,
457 trading days) for analysis. The thing we are going to explore is the predictive capability
of markets and traders.
4.3.1
Market Prices and Trade Volume
In prediction markets, we often first choose the last transaction prices of shares as prediction
measurement since these sets of figures should send the up-to-date information about future
event. In spite of that, these figures may deviate from rational levels occasionally when take
into account of the influence of market bubbles, market manipulation or non-rationally trader
behaviours. In this regards, in the following study we calculated the average transaction
prices of each share on a daily basis instead of last transaction prices. We consider the former
ones implies more accurate information while the latter ones contain more actual movements
about traders.
In addition, we also computed a total of trade volume of each country entity on a daily basis
to support the analysis.
20
4.3.2
Future Interest
In ExtZy, the dividend of each share is link to the Google search traffic volume for predefined country terms. In the following study, Google Trends is as selected to represent the
future interest in reality. With Google Trends, we can view and even compare the world’s
interest in different countries as shown in Figure 2.1.
Figure 4.1 Google Trends
Besides, we will distinguish between the normalized and non-normalized search data. All
data from Google Trends are normalized. Suppose that we don’t normalize the search
numbers and display the absolute value of countries, the results would not make any sense,
for example, China, a country of with dense population, definitely have a higher number of
searches every day than other countries.
21
4.3.3
Market Volatility
As mentioned before, the market prices of countries in ExtZy can be interpreted as a market
forecast on future interest. However, in this way we have little knowledge of the stability or
robustness of this estimation. By regarding the share price as a decisive factor, we are not
able to capture the implications hid inside such as how likely the price may go above or
below some specific points, etc. And beyond the average trading price of each country entity,
we should consider further information reflected by the market price to fully understand the
stability of the markets.
The following step is to study the volatility of the market. Volatility is a measurement for
price movement of a share in markets over time. In other words, volatility reflects the degree
of risk or uncertainty about the changes on market value [20]. In the following study, we will
firstly look at the historical volatility according to the historical behaviour, then to estimate
the option price by using Black-Scholes formula.
22
4.3.4
Supply and Demand Distribution
Like other prediction markets, traders in ExtZy make their offer prices individually based on
their estimations. This information, together with the quantity of offers can be used to
describe the relation between demand and supply. The imbalances between two sides could
lead to an uncompetitive price or incorrect aggregation of market information. With a limited
number of traders in ExtZy, the supply and demand curves could not demonstrate a
continuous shape but a stepped shape.
4.3.5
Prediction Accuracy
In this dissertation, the keywords like prediction accuracy and information aggregation
efficiency are always repeated. They are defines as the capability of an individual or market
to make the best assessment on a specific event with available resources or information.
Analogously, it is sensible to make a comparison on prediction accuracy of the same event
between traders. And also we can compare the predictive capability of the price series with
the average of individual forecasts on that event.
In the following study, we will adopt a quantitative method for the evaluation of the
prediction accuracy of ExtZy, which is to compute the ratio of accurately predicted events
within ExtZy Countries market
23
4.4
Data Preparation
This chapter explains the mathematic theories of automatic data processing in ExtZy database
and electronic data processing in excel after data query.
4.4.1
Dividend
As explained in previous sections, the dividends in ExtZy are calculated on a weekly basis
based on searches volume for each country entity. In case of a possible wide range of return
values, we use a logarithmic scale to calculate the actual earning of traders. The formula for
dividend calculation as following:
Each trader can receive a corresponding part from total dividend for each country according
to the shares they holds. The exchange rate of dividend and Zoints is 5:1. For example, if the
total dividend for the Entity 'United Kingdom' in a week was 1,000, therefore the total payout
in Zoint is 2,00. In this case, if you have 10 out of 1000 available shares. Your earning for
'United Kingdom' in this week should be 2 Zoints.
24
4.4.2
Price-Earning Ratio
By relating share prices with dividends, the P/E ratio highlights the relation between the price
and recent country popularity. If prices get lower and dividends get lower, the ratio will stay
the same. In real life, the share price rises usually before its dividend is increased since this
increase has already been discounted. In this case, the ratio will increase as price and
dividend become disconnected.
In this connection, when the ratio goes above or below the normal level, it implies that recent
dividend levels are no longer the main basis in pricing. The reason might be that the change
is ongoing and traders are expecting a much better or worse performance in the future.
Normally, the price-earnings ratio is defined as the nearest whole number of the ratio of the
latest price and the last 12 months’ earnings per share. In ExtZy, the price is the latest
transaction price and the earnings per share represent the sum of the dividends per share
calculated over the last rolling 52-week period. And the P/E Ration here is usually a decimal.
The formula as follows:
25
4.4.3
Historical Volatility
In stock markets, the share price is normally observed at fixed intervals of time (i.e. days,
weeks, months) for the estimation of volatility. The historical volatility mentioned in this
study is on a daily basis and represents the volatility of historical path of past trading prices
for a particular country or the whole market. The calculation of historical volatility in ExtZy
is given by following steps:
Firstly, the log relative returns ui are defined as.
where S represents daily closing value for ExtZy Countries Markets
Then, the estimated volatility σ can be calculated by
and
Where n represent the number of daily values includes in moving samples
Last, to normalize the estimation with the number of intervals per annum T
In this case, the daily data is used and thus we use T =365.
26
4.4.4
Pricing Options and the Black-Scholes Formula
The theoretical value for a standard European option can be calculated by the formula of B-S
Model. This formula is consist of six parameters, includes stock price, strike price, volatility,
risk-free interest rates, time to expiration and option price. And if any five of them are given,
we can solve the value of the sixth parameter based on this formula. In the following study,
we will firstly use the historical volatility before to arrive at the theoretical value for each
country option by following steps:
Call option
Put option
Where
,
According to the actual situation in ExtZy Countries Market, the stock price is the same as
the strike price (i.e. S=X) and the risk-free interest rate is equal to 0 (assume as 5% later).
27
4.5
Empirical Results and Analysis
The following study is conducted with the methods described in previous chapters by using
the data or derived data collected from ExtZy within the scope.
4.5.1 General Observations
There are a total number of 245 country entities in ExtZy and 8 out of them haven’t got any
transactions and market price. Up to Sep 1st, 2011, 672 participants are registered on ExtZy.
The results showed in Table 4.2 revealed the overall activity of ExtZy Countries Markets
since the launched date, Apr 13th, 2009.
ExtZy
Average [Range]
Sum
Transactions per entity
648.30 [2-3328]
153,933
Offers per entity
268.35 [1-1485]
64,788
Transactions per day
176.33 [1-16,374]
153,933
Offers per day
74.21 [1-6839]
64,788
Traders per entity
24.6 [12-95]
557
Table 4.2 General Observations on ExtZy
From the table above, it can be seen that the average number (24.6) of activity traders on each
entity is relatively lower than other prediction markets. However, 557 of registered users
participated into the trades on ExtZy Countries Market. Each entity has attracted at least 12
traders while the most popular one have absorbed 95 traders during the past more than two
years. Therefore, we can rely on the market results from ExtZy in the following study.
28
4.5.2 Prediction Accuracy
In this section, the main premise of this study is that the market price reflects all known
information and is the best predictor of the future interest of a country. To focus in depth in
the predictive accuracy of ExtZy, we have examed the market behavior of 50 country entities
selected at random and compared with their search indexes in reality. These entities were
randomly divided into 25 groups to examine that whether a higher trading price in ExtZy
could imply a higher future interest, respectively.
In this case, the price was the last trading price by Dec 31st, 2010 and the search index was
the normalized average search index in the following week reported on Aug 7th from Google.
As shown in Table 4.3, 17/25 (68%) of the cases predicted the more popular country
correctly. Though this figure could not represent the predictive accuracy of ExtZy at anytime,
we could find that the market price in ExtZy performed quite well in predicting country
interest by the collective wisdom of traders in this investigation.
29
Countries
Price
Search Index
United Kingdom, Chile
4.85/1.75
1.00/19.0
Turkey, Spain
3.99/2.50
1.00/1.13
Japan, Korea
7.37/6.00
0.65/0.25
Pakistan, Emirates
4.86/1.25
1.10/0.34
Germany, Australia
3.82/2.00
1.05/4.80
India, China
13.99/7.99
1.00/0.34
South Africa, United States
9.99/7.77
0.98/0.68
Indonesia, Sweden
3.01/1.79
1.11/0.16
Canada, Singapore
2.40/1.71 2.54/1.02
Nigeria, Georgia
6.95/5.49 1.14/2.54
Uganda, Slovakia
1.56/0.57 0.88/0.45
Denmark, Iceland
2.08/1.58 1.14/0.84
Poland, Italy
1.85/4.99 0.98/4.22
Viet Nam, Ireland
1.25/1.52
1.04/1.92
Haiti, Brazil
3.21/3.87
0.66/2.72
Slovenia, Mexico
1.70/4.00
1.00/74.0
Romania, Portugal
1.95/1.39
0.96/2.26
Afghanistan, Iraq
2.00/4.50
1.31/0.69
France, Libya
2.97/2.39 0.88/0.02
Yemen, Finland
3.02/2.99 0.56/2.44
Greece, Nepal
2.19/2.01 0.89/0.47
Norway, Egypt
1.99/1.98 1.00/1.60
Austria, Iran
1.73/0.75 1.01/0.90
Netherlands, Afghanistan
1.99/4.00
0.94/1.80
Thailand, Argentina
1.50/1.77
1.02/3.64
Table 4.3 Prediction Accuracy of Trade Price
30
4.5.3 Empirical Results
In this section, I reselected 48 sample countries, which may have big events during the
chosen period (May 1st 2010 to Aug 1st 2011, 15 months, 457 trading days) to explore
whether the search spikes can indeed be predicted in ExtZy. Then the study will make further
analysis on some typical country entities to verify the accuracy of ExtZy outputs against the
reality and thus gain insights in the trader behavior in real life.
Case One: Libya
Since February 17, 2011, the unrest in Libya was growing and Libyan current government
was experiencing a full-scale revolt. After one month of evolution (March 21, 2011), it turned
to be a war against international military forces. The following Figure 4.2 and 4.3 compares
ExtZy outputs with reality.
Figure 4.2 Price-Earning Ratio and Trade Volume: Libya 31
Figure 4.3 Price-Earning Ratio and Trade Price: Libya
As the above chart shows, these events do have a great impact on market behaviour. The
searches spiked during that period on Google. In ExtZy, there was a large volume of
transactions (Mar 19, 2011) before the war really broke out, which indicated that traders
expect an increasing trend of this country. In fact, the price before the war can be seen as a
fairly low level with the highest value of 0.08 Zoints per share, but after the war, the market
value of Libyan leapt to 1.60 Zoints per share.
Besides, the P/E ratio had a long period below the average level before February 2011. After
the war, the P/E ratio increased sharply to 9.06 (Mar 24), which reflected an increasing
confidence in the growth potential of the entity. Several weeks later, it steadily decreased to
2.458 and the price is unchanged, which implies for every 2.458 points the share cost, it paid
one points in dividends. That is to say the entity has been more profitable for its holders.
32
In addition, the distribution of supply and demand corresponded to the offers’ prices of Libya
are demonstrated in the following Figure 4.4
Figure 4.4 Supply and Demand Distribution: Libya
As shown in above chart, several offers emerged together during the period of Libya war.
Due to the imbalance between supply and demand, the market was lack of liquidity and may
lead to an uncompetitive price. In prediction markets, these offer prices should logically
associated with the trader’s assessment on the underlying future country interest together
with the offered quantities. In this case, the total demand quantity (Feb, 2011- Apr, 2011)
reached to 350 with an average bid price at 1.134 Zoints per share while the supply quantity
was 95 at a price of 3.25 Zoints per share. Before the Libya war, the market price of this
entity showed in Figure 4.3 was as low as 0.08 Zoints per share.
33
Actually, it’s difficult to take all the market factors into consideration, such as the difference
in the number of participants in markets, the liquidity of the markets, how much the
information actually affects the traders’ behaviour, etc. In this regards, we can assess the
accuracy by whether the new additional information will change the original trend of the
entity. As shown in above charts, since plenty of media reports have covered on the civil
unrest in Libya, the market presented a period of unusually active behaviour, which lead to a
higher value of share price than its average level before.
Figure 4.5 Moving 1-Week Historical Volatility: Libya
Furthermore, the moving historical volatility of Libya showed the price fluctuation since
May, 2011, which proved that the market price of Libya entity indeed change dramatically
during that time of period.
The similar variations also appeared when a series of protests occurring in Egypt, Sudan and
Jordan. All the relevant results can be seen in Appendix C.
34
Case Two: Spain
During the summer in 2010 (Jun 11- Jul 12), Spain put all to rout to get into the world cup
finals. On 12 July 2010, Spain defeated Netherlands to win the 19th FIFA World Cup held in
South Africa. Football is the most favorable sports event in Europe and even in the world.
Traders can have access to any event information easily through a variety of ways. In this
way, they were able to attempt a judgment before the game. Figure 4.6 and Figure 4.7
presents the market behaviour on this event.
Figure 4.6 Price-Earning Ratio and Trade Volume: Spain
35
Figure 4.7 Price-Earning Ratio and Trade Price: Spain
As shown in charts, there was a large volume of transactions at an average price of 1.74
Zoints per share before the finals on 8 Jul, 2010, which was almost twice of the original trade
price. On 13 Jul, 2010, the day after the finals, the market price returned to 1.03 Zoints per
share immediately which indicated that traders expect a decreasing trend on Spain after
World Cup finals. In real life, as the grey shadow demonstrated in charts, the search index
has been increased from 0.63 to 1.52 during World Cup and decreased sharply to 0.54 in the
following week.
Besides, the distribution of supply and demand corresponded of Spain are demonstrated in
the following Figure 4.8.
36
Figure 4.8 Supply and Demand Distribution: Spain
It can be seen that on Jul 11, 2010, there was a heavy demand for Spain suddenly in the
markets. And the volatility in following chart also illustrated an extraordinary variation on
price before the games.
Figure 4.9 Moving 1-Week Historical Volatility: Spain
37
All the data above showed a higher valuation and interest on Spain before the World Cup
final. That is to say, traders expected a better performance of Spain on the future performance
of the underlying event. In this regards, this expectation indeed agree with the actual results
in reality. The similar situations can also be found on the trade performance of some other
competing nations, such as Germany, Argentina and Netherlands. All the relevant results can
be seen in Appendix C.
38
However, traders in ExtZy were not capable of responding to all kinds of situations in
advance. The following study will explain the other two cases in detail.
Case Three: Japan
On March 11, 2011, an 8.9 Richter scale earthquake shook the northeast of Japan. The quake
set off a massive tsunami, explosions and fires. Further, the Fukushima Nuclear Power Plant
burned due to the terrible quake-tsunami. All sides in world attached high attention to this
disaster in Japan as the grey shadow displayed in the accompanying charts (Figure 4.10 and
Figure 4.11), the search index turned extremely high.
Figure 4.10 Price-Earning Ratio and Trade Volume: Japan
39
Figure 4.11 Price-Earning Ratio and Trade Price: Japan
In the ExtZy markets, there were also some frequent trades once the news spread out. It can
be seen that the price of Japan jumped to 4.07 and then reached 8.72 Zoints per share on Mar
17 and the P/E ratio increased to over 5, which was at a significantly higher level than before.
Figure 4.12 Supply and Demand Distribution: Japan
40
Figure 4.13 Moving 1-Week Historical Volatility: Japan
As shown in above charts, traders respond swiftly to the market changes after the spikes from
Google. Therefore, it is easy to detect that people usually use the present (adding their
experience judgment) to shape their view of the future. For issues like wars (case one), sports
games (case two), etc., people could estimate their trends in advance and thus traders’
behaviour could lead the reality. But in this case, when users come up against unexpected
events, such as natural disaster or contingency, their behaviour would definitely lag behind
the reality.
The similar trends can also be seen after the earthquake happened in Haiti and the Volcano
eruption occurred in Iceland. All the relevant results can be seen in Appendix C.
41
Case Four: Korea North
Figure 4.14 Price-Earning Ratio and Trade Volume: Korea North
Figure 4.15 Price-Earning Ratio and Trade Price: Korean North
42
As illustrated in above charts, though there were two sudden spikes in search volume on July
and September 2010, the marketplace maintained a steady state. The markets did not respond
to the events in advance, not even after that.
Besides, there was no additional buy or sell offers and variations on market price. In this
case, the market price cannot reflect all the information related to the events completely
which may cause by the insufficient knowledge of North Korea among traders.
Such flat price trends also appeared when the search spikes came out in Nepal, Switzerland
and Somalia. All the relevant results can be seen in Appendix C.
43
Furthermore, what might happen in ExtZy if there were no such big events as previous cases
during the observed 15 months? Keeping at a low market price?
Case Five: United States
United States has global impact on economic, political and intellectual climate and has been
the focus of attention and discussion all along. There are always much information and news
on this country every day. From May 1, 2010 to Aug 1, 2011, there were no obvious spikes
on Google Trends as demonstrated in following graphs.
Figure 4.17 Price-Earning Ratio and Trade Volume: United States
44
Figure 4.18 Price-Earning Ratio and Trade Price: United States
However, there have always had some transactions in the markers with a relatively high trade
price, which reflected a continuous high expectation on this entity.
Figure 4.19 Supply and Demand Distribution: United States
45
Additionally, the demand for this entity remained high, despite its high price. Therefore, not
only the search spikes can be predicted by the aggregated information of traders, but also
relative trends can be predicted, which have been discussed earlier in Chapter 4.5.2.
Figure 4.20 Moving 1-Week Historical Volatility: United States
The similar situations can be found on the trade performance of United Kingdom and China.
All the relevant results can be seen in Appendix C.
46
4.6
Conclusions on Analysis Result
Actually, it’s difficult to draw a conclusion on the prediction accuracy of ExtZy on different
events. In this study, But we have indeed found some necessary relations between the market
behavior and future country interest (searches).
As the previous evidence shown, the ExtZy are not fluctuating randomly. Generally, the
market price in ExtZy performed quite well in predicting country interest by the collective
wisdom of traders in this investigation. ExtZy indeed can be used to predict search trends and
spikes in some cases.
People usually use the historical performance with their experience judgment to shape their
view of the future. For issues like wars, sports games, elections and even government policy,
people could estimate their trends in advance and thus traders’ behaviour could lead the
reality. But when traders come up against unexpected events, such as natural disaster or
contingency, market behaviour would definitely lag behind the reality.
As prediction markets, the enthusiasm for ExtZy is on the basis of the efficient markets
hypothesis. The market price should be the best indication of the underlying event in a truly
efficient prediction market.
47
However, as the historical volatility charts illustrated previously, the market price in each
market always changed to an irregular level significantly. Theoretically, such situations can
only appear in the market with few participants and come with the use of virtual money.
In this case, traders may not have the motivation to trade rationally without the real purpose
of earning profits and thus the market price cannot reflect the true assessment of each
individual. In other word, if there are a sufficient number of traders in each market, others
can force the price to the normal level. However, few traders continuously appear to track the
performance in prediction markets.
Additionally, for each country entity, the ExtZy issued 1000 shares when it started. Although
there is an appropriate match mechanism between buyer and seller, once some big
shareholders hold a large volume of shares, the market liquidity in ExtZy turns to be low.
This imbalance between supply and demand may lead to incorrect aggregation of market
information and thus an uncompetitive price.
In order to make further research on the accuracy of information aggregation of ExtZy, we
will implement some continuously updated pages for individuals to measure the market
activity in following chapter.
48
CHAPTER 5 --IMPLEMENTATION & TESTING
This chapter includes the database and webpage implementation for exploring the previously
presented analysis in chapter 3 and 4.
5.1
Requirements Gathering
As mentioned in previously analysis, the additional requirements for overall objectives of this
study are listed below:
RQ-1. The system must allow the users to access instantaneous information about account.
RQ-2. The system must allow the user to access a list of historical transactions.
RQ-3. The system must allow the users to search for a specific period of transaction history.
RQ-4. The system must allow the users to visually browse the history list in different orders.
RQ-5. The system must have output of charts and tables for fundamental data of each entity.
RQ-6. The system must provide an instantaneous visualization of the market volatility index
RQ-7. The system must allow the user to calculate the estimated option price of counties
entity based on the historical volatility.
RQ.8. The system should allow the user to enter the time to expiration, risk-free interest rate
to recalculate the option price
49
5.2
Database Architecture
After extracting information from the results of analyzing the requirements, Figure 5.1 shows
an Entity-Relationship diagram of the ExtZy database with the most important 10 entities for
this study, including players, playerdata, entities, entitydata, history, offers, dividends,
activity, transactions and volatility. The primary key for each entity is underlined in the ER
diagram.
The players table contains the account details of each player and also the current portfolio
value updated after each transactions.
The playerdata table records the historical account data correspond to each playerID on a
daily basis and adds to the queue.
The entities table contains the intrinsic data of each entity and also the current market value
updated after each trade.
The entitesdata table records the historical entity data correspond to each entityID on a
weekly basis and adds to the queue.
Transactions and offers are listed in different tables. The offers table stores only details of
unmatched offers. Once they are matched, the end date of this offer would be wrote into the
respective field in the offers table and a new transaction record would appear in the
transaction table. The transactions table also includes the uniqueID of both the previous
owner and current owner of each transaction.
The history table contains the history records including total dividend payout, last transaction
volume and P/E Ratio for each entity on a weekly basis.
The dividend table connects both players and entities tables. Each record corresponds to the
dividend that paid from a specific entity to a specific player on a weekly basis.
50
The activity table contains the search hits correspond to each entityID.
The marketindex table stores a list of market index of the whole ExtZy Countries markets.
Figure 5.1 Entity Relationship Diagram
51
5.3
Development Environment
Python was chosen as the scripting language for the server-side webpage development in this
study. The implementation of design was made more conveniently and efficiently due to the
dynamic and object-orientated features of Python language,
IDLE
IDLE is an Integrated Development Environment (IDE) for Python development built with
Tkinter GUI toolkit. It provides an enhanced interactive shell window for coding and
executing pure python source code. And it also enables a debugger to remove bugs, providing
functions like breakpoints, stepping and variable monitoring in order to improve the
efficiency of development.
My SQL and phpMyAdmin
My SQL is an open source database system for storing information into categories. It acts as
a database server providing users access to the information. phpMyAdmin is a Web-based
front end application integrated with MySQL and enable users to work with data and
database structure visually.
YUI 2 Library
YUI 2 is an external library written in JavaScript for building interactive web applications.
52
5.4
Webpage Implementation
The following chapter contains the further implementations of ExtZy markets in this research
used for exploring the analysis.
Figure 5.2 depicts the designed transaction history page of the trader’s account. The system
automatically sends the records for the most recent 30 days. At the head of this page, traders
could access instantaneous information about his account including balance, portfolio value
and ranking, etc.
Figure 5.2 Transaction History Page 1
53
Traders can also enter the period of history they want to observe by changing the number of
days circled in the picture. "0" days returns today's transactions only and "600" returns the
transaction records in the past 600 days.
Figure 5.3 Transaction History Page 2
Each page of the history has 10 records of transaction. Each records details the transaction
ID, transaction date, time, transaction type, old or new owner ID, entity name, price, quantity,
and total payment. As mentioned in Chapter 3, all trades in ExtZy are anonymous and traders
are not able to recognize the identity of other traders in transactions.
54
For each transaction, traders could choose the entity traded before for more details. The
following screen Figure 5.4 shows past performance of United States which is trade on Sep 6,
2011 at a price of 7.99. The graphs will show the historical data of the shares price, trade
volumes and Google Hits for the chosen period. (All these data are used for analysis
presented in Chapter 4 but the figures are drawn in excel to make the analysis clearly) Figure 5.4 Entity Data
55
Additionally, traders could visually browse the historical records in different orders, e.g.
according to transaction date, type, entity name and total payment etc. The following graph
Figure 5.5 sorted the records by total payment, from highest to lowest.
Figure 5.5 Transaction History Page 3
The exception for this is that if there is no transaction during the search period. There would
be a reminder and also navigation to a list of share (Details will be attached in Appendix A).
Figure 5.6 Transaction History Page 4
56
Furthermore, there would be a dynamic view of historical volatility index for traders to
observe the markets and make sensible decisions. This historical index is calculated on the
basis of the market index as shown in Figure 5.8. As mentioned before, the historical
volatility in this study is on a daily basis and represents the variation of historical path of past
market capitalization of the whole Countries market.
Figure 5.7 Countries Volatility
Figure 5.8 Countries Market Index
57
At last, ExtZy Countries will introduce option contracts. By applying Black-Scholes model to
prediction markets, traders are able to estimate prices of option that is at-the money with
different time to the expiration date. Figure 5.9 depicts the estimated option price of Japan
based on its historical volatility.
Figure 5.9 Estimated call and put option price of Japan (30 days to expiration)
58
Trader could enter the days to expiration, risk-free interest rate to recalculate the option price.
Figure 5.10 Estimated call and put option price of Japan (180 days to expiration)
59
5.5
Testing
This section aims to ensure the actual outcome is in line with our expected results. Each
interface is tested individually to compare with the outcome from database or results
calculated in excel sheet. And the outputs are monitored continuously to ensure the system
working and displaying correctly. Testing of this system was done by separated print
commands, which help to find and debug errors earlier.
Besides, the following functionalities will be tested:
•
The transaction details are being reading in correctly
•
The default values were set up correctly
•
The data of the entities or markets are being reading in and figuring correctly
•
The calculations are being calculated continuously and correctly
60
5.6
Validation
The section focus on checking the functionalities of the system it should have and the page
working as expected. The validation in this study is conducted by comparing real outputs
from database with the results page.
1. Change the default playerID in TransactionHistory.py code documents and rerun the
program. The page displayed as follows:
Figure 5.10 Transaction History Page (playerID=3184356239164844 and Days=500)
Run the following SQL query on database:
SELECT DATE(t.created) AS Day,TIME(t.created) AS Time, trid, transaction,
entityID, old_owner, new_owner, EntityName, t.price, quantity,
t.price*quantity
FROM transactions t, entities e
WHERE (new_owner=3184356239164844 OR old_owner=3184356239164844) AND
iid=entityID
GROUP BY Day,Time
ORDER BY t.created DESC
LIMIT 0,10
61
The query results shown in Figure 5.11 are exactly corresponded to the records demonstrated
on transaction history page Figure 5.10. Therefore, the transaction details were read correctly
Figure 5.11 Query Result (Transaction History)
2. Export the market data into Excel sheet from database. Calculate the Historical Volatility
with the formula in Chapter 4.4.3 and plot a chart as follows:
Figure 5.12 Historical Volatility Chart in Excel
Compare with the Countries Volatility Chart in Figure 5.7, we could find that it is consistent
with the output of the chart. Therefore, the calculations were calculated and figured
continuously and correctly.
62
CHAPTER 6 --SUMMARY AND CONCLUSIONS
To sum up, the ExtZy are not fluctuating randomly. Data for empirical analysis was selected
randomly through a set of 256 country entities that were run since Apr 2009 for exploring the
relation between market price and search index. In this regard, we came to the conclusion that
a higher price could imply a higher search index. Then the study focused on several countries
specifically to investigate the causal connection between search spikes and market data.
Generally, the market price implied relatively high prediction accuracy in predicting country
interest by the collective wisdom of traders. ExtZy indeed can be used to predict search
trends and spikes in some cases.
As mentioned in Chapter 4, people usually use the historical performance with their
experience judgment to shape their view of the future. For issues like wars, sports games,
elections and even government policy, people could estimate their trends in advance and thus
traders’ behaviour could lead the reality. But when traders come up against unexpected
events, such as natural disaster or contingency, market behaviour would definitely lag behind
the reality.
The second remarkable thing of ExtZy is the utilization of the basic design idea. It is simple
enough for every participant to understand that more searches on a country from Google
correspond to a higher dividend and thus the price. Due to this simple design concept, people
would like to join this markets immediately and do not need to spend too much time on
learning it.
63
However, there are also several limitations on this study. Firstly, it’s difficult to evaluation
the prediction accuracy of prediction markets on different underlying event. In ExtZy, the
searches may increase as a result of a war, a natural disaster and even the death of a public
figure in a country. In this case, research on several individual cases may limit the ability to
generalize the general conclusions.
Additionally, this study was based on a relative small number and groups of participants who
were almost employees or customers of Z/Yen. If there were a sufficient number and groups
of traders in each market, the results would aggregate more information from a much larger
number or groups of traders with a higher accuracy.
Furthermore, predicting future volume of countries interest seems a rather limited application
of a prediction market. If the ExtZy is an accurate predictor, how should Z/Yen use this
information?
Further Development
The findings in this study indicate that the market designers need to pay more attention on the
market liquidity in ExtZy. The market price (index) in ExtZy always changed to an irregular
level (extremely high or low) significantly. Theoretically, such situations can only appear in
the market with few participants and come with the use of virtual money. Therefore, further
development could focus on how to promote enthusiasm and initiative as well as motivation
to trade rationally.
In addition, the sources of information deserve further attention. As shown in this study, there
might be potential for an increase in prediction accuracy if traders are well informed and the
information origin is widespread.
64
Furthermore, as mentioned previously, ExtZy Countries will run “prediction markets” on the
results of ExtZy by introducing option contracts. In this study, we have already developed an
interface for trader to estimate prices of option that is at-the money with historical volatility.
When we get the actual option price in markets, we could identify the range of implied
volatility also by Black-Scholes Model and thus make a more sensible decision. In this
regard, there might be potential for an increase in individual prediction accuracy if the trader
interface built with a market index (VIX) indictor.
65
APPENDIX A --SYSTEM MANUAL
Fig. 0.1 depicts the homepage of the ExtZy. The entry screen shows the newest
registered entities, the most popular or valued entities and the top 5 player rankings.
The traders could get a figure of market index.
Fig.A1Entry Screen
66
Fig.A2 depicts listing of ExtZy Countries Market. The screen listed all shares with
information including best offer prices, dividends, average trader price last week, P/E
ratio and market capitalization etc. Traders could sort the list according to entity
name, offer price, dividend as well as P/E ratio and so on.
\
Fig.A2 Market Data
67
Click on any country for a description of its details. Fig.A2 depicts the historical data
on selected entity for a better understand on its current state and popularity.
Fig.A3 Entity Data
The graphs show the historical data including the price of shares, the trade volume,
and the Google hits. And the page also includes a link to the relevant news on Google
News, which provided a larger amount of reference on selected entity.
68
Clicking on “Buy Shares Now" button, which is a pointer to purchase screen as
Figure.A3.
Fig.A4 Purchase screen
On this page, traders have two options: one is to buy a number of shares at current
available price and one is to make an offer to buy at his expected price.
Fig.A5 Make offer to Buy screen
Then the trader could enter his desired price and quantity. If the trader allows the
system purchase shares automatically when they become available at your price, set
the “Partial” option as “Yes” and click "Make New Offer To Buy". Then a new offer
will be made.
69
Trader could increase his balance by buying shares at a lower price and selling them
at a higher price. There is a value indicator at the top of "My Share Portfolio" screen
to help you identify profitable shareholdings
Fig.A5 Value indicator
Figure. A6 depicts a list of current shareholdings on the trader account page. This
page gives an overview over the details of each share the trader holding.
Fig.A6 Current Shareholdings screen
Trader can also place offers to sell his current shareholdings onto the ExtZy market by
clicking on “sell”. Figure. A6 displays the sell screen, which works similar to the
purchase screen.
Fig.A6 Sell screen
70
Then the trader could enter his desired price quantity and click "Make New Offer To
Sell". Then a new offer will be made.
Fig.A7 Make Offer to Sell screen
To view your dividend history to date, choose "My Account" from the horizontal
navigation bar on the top of ExtZY main page, and then "Dividend History": ExtZy
will display you a table of the dividend history on a weekly basis as shown in Fig.A8.
Fig.A8 Dividend History screen
71
APPENDIX C --DATA PRE-PROCESSING QUERY
Transaction Volume per day
SELECT SUM(quantity), DATE(t.created)
FROM transactions t,entities e
WHERE iid=entityID AND Company='Countries'
GROUP BY DATE(t.created)
ORDER BY `t`.`created`
ASC
Offer per day
SELECT SUM(N), DATE(o.created)
FROM offers o,entities e
WHERE e.iid=EntityID AND Company='Countries'
GROUP BY DATE(o.created)
Transaction per entity
SELECT SUM(quantity), entityID
FROM transactions t, entities e
WHERE iid=entityID AND Company='Countries'
GROUP BY entityID
Offer per entity
SELECT SUM(N), EntityID
FROM offers o,entities e
WHERE e.iid=EntityID AND Company='Countries'
GROUP BY EntityID
72
Trader per entity
SELECT COUNT(playerID), entityID
FROM shareholdings s, entities e
WHERE e.iid = entityID AND Company='Countries'
GROUP BY entityID
Trader Number
SELECT COUNT(DISTINCT(playerID))
FROM shareholdings s, entities e
WHERE e.iid = entityID AND Company='Countries'
Transaction Records of entity (entityID =3243897527679629)
SELECT
DATE(created),SUM(quantity),MIN(price),MAX(price),AVG(price)
FROM `transactions`
WHERE
`entityID` = 3243897527679629
GROUP BY
DATE(created)
ORDER BY
`transactions`.`created` ASC
Offer Records of entity (entityID =3243897527679629)
SELECT DATE(created),BuySell, N, Price, FromDate,UntilDate
FROM `offers`
WHERE
`entityID` = 3243897527679629
GROUP BY
DATE(created)
ORDER BY
`offers`.`created` ASC
73
APPENDIX D --EMPIRICAL RESULTS
74
APPENDIX E --CODE LISTS
1. TransactionHistory.py
# This code document is written for implementation of Transaction History Page.
##!/usr/bin/python import cgi, sys; sys.path.append('/home/fm2x/www/QPy') import cgitb; cgitb.enable(); from Vars import *; from Data import *; from Form import *; sys.path.append('/home/fm2x/www/py/report'); from YUITable import *; sys.path.append('/home/fm2x/www/py/'); from database import *; from Header import *; form=cgi.FieldStorage(); Days=form.getfirst("Days","30"); Return=form.getfirst("Return","Market Data"); iid=form.getfirst("iid",""); #Sortkey=form.getfirst("Sortkey","EntityName"); PlayerID=form.getfirst("PlayerID",""); JoomlaID=form.getfirst("JoomlaID","") NaSign="-‐"; if len(sys.argv)>1: Access='indirect'; for i in range(1,len(sys.argv)): if sys.argv[i].count('|')<>1: continue; x='''%s="%s"'''%(sys.argv[i].split('|')[0],sys.argv[i].split('|')[1]) exec(x); if PlayerID=="": try: sql='''select iid from players where JoomlaID="%s"'''%JoomlaID; db.execute(sql); PlayerID=db.fetchone()[0]; except: print "Please login"; sys.exit(); 75
if len(sys.argv)==1: print "Content-‐Type: text/html\r\n\r\n",GetHeader(PlayerID),'<body class=" yui-‐skin-‐sam">'; else: print '''<div class=" yui-‐skin-‐sam">'''; try: if long(Days)>(365*30): print '<h2>Too many days!</h2>'; sys.exit(); except: print '<h2>Bad entry of days!</h2>'; sys.exit(); if PlayerID=="": print '''<h2>Bad PlayerID!</h2>'''; sys.exit(); print '<h2>Transaction History</h2>' sql='''SELECT DATE(NOW()-‐INTERVAL %s day)'''%(Days,); db.execute(sql); r=db.fetchall(); StartDate=str(r[0][0]); StartDate=StartDate.replace('-‐',''); if PlayerID>0: # print '''<p> <a href="javascript:history.go(-‐1)">%s</a> > Transaction History'''%Return; print '''<p> <a href="%s/index.php?option=com_extzy&task=Leaderboards&Itemid=135" target=_parent>%s</a> > Transaction History '''%(Live_Site,Return); print '''<form action="TransactionHistory.py">''' print '''<h3><b>Your transaction history for the last %s days (from %s)</b> <input type=text size=3 name="Days" value=%s style=text-‐align:right;> <input type=submit value="Days"> <small>( 0 is today only)</small></h3> <input type=hidden name=PlayerID value="%s"></form> '''%(Days,StartDate,Days,PlayerID); #################################### sql='''SELECT DATE(created) AS Day,TIME(created) AS Time,trid,transaction,entityID,old_owner,new_owner, (SELECT EntityName FROM entities WHERE iid=entityID) AS entity, price, quantity FROM transactions WHERE (new_owner=%s OR old_owner=%s) AND created>=%s GROUP BY Day,Time ORDER BY created DESC'''%(PlayerID,PlayerID,StartDate); #SELECT Value FROM playerdata p,transactions t WHERE DataType='Balance' AND p.created=t.created AND PlayerID=new_owner) AS nvalue try: db.execute(sql); r=db.fetchall(); except: r=[]; 76
numberent=len(r); if numberent>0: # print '''<p><table class="fctable" border=0><td align=center class=fcable>Transaction Date # <td align=center class=fctable>Time<td align=center class=fctable>Transaction ID # <td align=center class=fctable>Type<td align=center class=fctable>Supplier/Customer ID # <td align=center class=fctable>Entity Name<td align=center class=fctable>Trade Price # <td align=center class=fctable>Volume<td align=center class=fctable>Total Payment''' table='''<thead><td>Transaction Date<td>Time<td>Transaction ID<td>Type<td>Supplier/Customer ID <td>Entity Name<td>Trade Price<td>Volume<td>Total Payment</thead>'''; for Day,Time,trid,transaction,entityID,old_owner,new_owner,entity,oid,nid,price,qua
ntity in r: e='''<a href="%s/index.php?option=com_extzy&task=EntityData&Itemid=67&EntityID=
%s" target=_parent>%s</a> '''%(Live_Site,entityID,entity); if old_owner==PlayerID: # o='''<a href="%s/index.php?option=com_comprofiler&task=userProfile&user=%s&Ite
mid=64" target=_parent>%s</a> # '''%(Live_Site,nid,new_owner); o=new_owner else: # o='''<a href="%s/index.php?option=com_comprofiler&task=userProfile&user=%s&Ite
mid=64" target=_parent>%s</a> # '''%(Live_Site,oid,old_owner); o=old_owner table+= '''<tr><td><div style="text-‐align:center">%s</td><td><div style="text-‐align:center">%s</td> <td><div style="text-‐align:center">%s</td><td><div style="text-‐
align:center">%s</td> <td>%s</td><td>%s</td><td>%.2f</td><td>%s</td><td>%.2f</td><td></tr
> '''%(Day,Time,trid,transaction,o,e,price,quantity,price*quantity); else: print '''<p2> You have not had any transactions for the last %s days, if you wish to buy please click <a 77
href="%s/index.php?option=com_content&view=article&id=67&Itemid=80"targ
et=_parent>here. </a>'''%(Days,Live_Site); table=""; columns=''' {key:"day",label:"Transaction Date",sortable:true}, {key:"time",label:"Time",sortable:true}, {key:"trid",label:"Trans ID",sortable:true}, {key:"transaction",label:"Type",sortable:true}, {key:"owner",label:"Supplier/Customer ID",sortable:true}, {key:"name",label:"Entity Name",sortable:true}, {key:"price",label:"Price",formatter:myFormatCurrency,sortable:true}, {key:"quantity",label:"Vol",formatter:'number',sortable:true,width:20}, {key:"total",label:"Total Payment",formatter:myFormatCurrency,sortable:true}, '''; fields=''' {key:"day"}, {key:"time"}, {key:"trid"}, {key:"transaction"}, {key:"owner"}, {key:"name"}, {key:"price", parser:YAHOO.util.DataSource.parseNumber}, {key:"quantity",parser:YAHOO.util.DataSource.parseNumber}, {key:"total",parser:YAHOO.util.DataSource.parseNumber}, '''; # print '''<tr><td class=fctable>%s %s<td align=center class=fctable>%s<td align=center class=fctable>%s # <td align=center class=fctable>%s<td align=center class=fctable>%s<td align=center class=fctable>%s # <td align=center class=fctable>%.2f<td align=center class=fctable>%s<td align=center class=fctable>%.2f # '''%(Day,DayName[:3],time,trid,transaction,old_owner,e,price,quantity,price*qua
ntity); print '''<p><div id="markup">'''; #this is essential per table print YUITablePaged(table,columns,fields,tablename="transactions",rowsperpage=10)
; #simple call print '''</div>'''; if len(sys.argv)>1: print '</div>'; 78
2. VIX.py
# This code document is written for calculation and insertion of new volatility data.
#!/usr/bin/python import cgi, sys; sys.path.append('/home/fm2x/www/QPy') import cgitb; cgitb.enable(); from Vars import *; from Data import *; from Form import *; from math import *; import sys; sys.path.append('/home/fm2x/www/py/report'); from YUITable import *; import sys; sys.path.append('/home/fm2x/www/py'); from database import *; from Header import *; import datetime; db.execute('select date(now())'); today=db.fetchone()[0]; Leaderboard='Countries' def stdv(r): from math import sqrt n,mean,std= len(r),0,0 for a in r: mean+=a mean=mean/float(n) for a in r: std+=(a-‐mean)**2 std=sqrt(std/float(n-‐1)) return std sql='''SELECT date(date) from volatility where Leaderboard="Countries" ORDER BY date DESC LIMIT 1''' try: lastentry=db.fetchone()[0]; except: lastentry=datetime.date.min; if today<=lastentry: print 'VIX already calculated today'; else: sql=''' SELECT date,value FROM marketindex WHERE Leaderboard='Countries' ORDER BY date DESC;''' try: db.execute(sql); r=db.fetchall(); except: r=[]; logs=[]; i=0; for date,value in r: if i<7: 79
tVal=float(r[i][1]); yVal=float(r[i+1][1]); logReturn=log((tVal/yVal),e); logs.append(logReturn); i+=1; else: break std=stdv(logs) print stdv(logs) sql='''INSERT INTO volatility (date,Leaderboard,value) values ("%s","%s","%s")'''%(today,Leaderboard,std); db.execute(sql); 80
3. ChartTest.py
# This code document is written for testing the market volatility chart.
#!/usr/bin/python import cgi, sys; sys.path.append('/home/fm2x/www/QPy') import cgitb; cgitb.enable(); from Vars import *; from Data import *; from Form import *; import datetime; from Header import *; from pychartdir import * form=cgi.FieldStorage(); Leaderboard=form.getfirst("Leaderboard","Countries"); sql='''select date,value from volatility where Leaderboard="%s" order by date desc limit 90'''%Leaderboard; db.execute(sql); r=db.fetchall(); months=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; data=[]; labels=[]; for d,value in r: data.append(value); date=d.split('-‐'); if date[2].lstrip('0')=='1': day='1st '; elif date[2].lstrip('0')=='2': day='2nd '; elif date[2].lstrip('0')=='3': day='3rd '; else: day=date[2].lstrip('0')+'th '; # if d.day=='1': day='1st '; # elif d.day=='2': day='2nd '; # elif d.day=='3': day='3rd '; # else: day=d.day+'th'; datename=day+months[int(date[1])-‐1]; # datename=day+months[int(d.month)-‐1]; labels.append(datename); data.reverse(); labels.reverse(); ColorsLookupA={"Countries":0xdd0000,} ColorsLookupB={"Countries":0xdd0000,} if Leaderboard in ColorsLookupA.keys(): ColorA=ColorsLookupA[Leaderboard]; else: ColorA=0xdd0000 81
if Leaderboard in ColorsLookupB.keys(): ColorB=ColorsLookupB[Leaderboard]; else: ColorB=0xdd0000 # Create a XYChart object of size 250 x 250 pixels c = XYChart(185, 190, 0xffffff) # Set the plotarea at (30, 20) and of size 200 x 200 pixels c.setPlotArea(38, 17, 140, 120, 0xffffff,0xffffff,0x000000,0xC0C0C0,0xC0C0C0) if len(Leaderboard)>10: GraphTitle="%s Volatility\n%s"%(Leaderboard.upper(),r[0][0]); else: GraphTitle="%s Volatility %s"%(Leaderboard.upper(),r[0][0]); c.addTitle2(Top, GraphTitle, "arial.ttf", 8, 0xffffff, ColorA) c.addTitle2(Bottom, " ", "arial.ttf", 8, 0xffffff, ColorA) # Add a bar chart layer using the given data c.addLineLayer(data,0x000080) # Set the labels on the x axis. c.xAxis().setLabels(labels) c.xAxis().setLabelStep(14) #c.xAxis().setLinearScale(0, 5, labels) c.xAxis().setLabelStyle("arial.ttf", 7.5,ColorB,50) c.yAxis().setLabelStyle("arial.ttf", 7,ColorB,0) # output the chart #c.makeChart("simplebar.png") # output the chart print "Content-‐type: image/png\n" binaryPrint(c.makeChart2(PNG)) 82
4. BSModel.py # This code document is written for implementation of BS-model option price.
#!/usr/bin/python import cgi, sys; sys.path.append('/home/fm2x/www/QPy') import cgitb; cgitb.enable(); sys.path.append('/home/fm2x/www/py/report'); from YUITable import *; from Vars import *; from Data import *; from Form import *; from Header import *; from math import *; form=cgi.FieldStorage(); PlayerID=form.getfirst("PlayerID",""); OpType=form.getfirst("OpType","Call"); CurrPrice=form.getfirst("CurrPrice",""); StrPrice=form.getfirst("StrPrice",""); Days=form.getfirst("Days","30"); Vix=form.getfirst("Vix",""); Rate=form.getfirst("Rate","0"); EntityID=form.getfirst("EntityID","7307229069107385"); JoomlaID=form.getfirst("JoomlaID",0); Return=form.getfirst("Return","My Account"); if len(sys.argv)>1: Access='indirect'; for i in range(1,len(sys.argv)): if sys.argv[i].count('|')<>1: continue; x='''%s="%s"'''%(sys.argv[i].split('|')[0],sys.argv[i].split('|')[1]) exec(x); if PlayerID==0 and JoomlaID<>"0": try: sql='''select iid from players where JoomlaID="%s"'''%JoomlaID; db.execute(sql); PlayerID=db.fetchone()[0]; except: PlayerID=0; if len(sys.argv)==1: print "Content-‐Type: text/html\r\n\r\n",GetHeader(PlayerID),'<body>'; if PlayerID==0: if SiteName=="ExtZy": print '''<div class="greybox" style="width:500px"><span style="color:#b00;font-‐weight:bold;font-‐size:11pt">In order to trade this share you must log in to ExtZy first!</span><p> If you are not yet registered with ExtZy, please click <a href="%s/index.php?option=com_comprofiler&task=registers" 83
target=_parent>here</a> to create a new account. If you have already registered with another of the Z/Yen CommunityZ, then you can use this account to log in to ExtZy. Simply visit the "My CommunityZ" page within the community with which you have already registered to activate your ExtZy account. </div><br /> '''%Live_Site else: print '''<div class="greybox" style="width:500px"><span style="color:#55d;font-‐weight:bold;font-‐size:11pt">In order to trade this share you must log in to %s first!</span><p> If you are not yet registered with %s, please click <a href="http://www.mdgexchange.com/index.php?option=com_comprofiler&task
=registers" target=_parent>here</a> </div><br /> '''%(SiteName,SiteName); # Define the cumulative normal distribution def CND(X): (a1,a2,a3,a4,a5) = (0.31938153, -‐0.356563782, 1.781477937, -‐1.821255978, 1.330274429) L = abs(X) K = 1.0 / (1.0 + 0.2316419 * L) w = 1.0 -‐ 1.0 / sqrt(2*pi)*exp(-‐L*L/2.) * (a1*K + a2*K*K + a3*pow(K,3) + a4*pow(K,4) + a5*pow(K,5)) if X<0: w = 1.0-‐w return w # Define Black Sholes Function def blackSholes(CallPutFlag,S,X,T,r,v): d1 = (log(S/X)+(r+v*v/2.)*T)/(v*sqrt(T)) d2 = d1-‐v*sqrt(T) if CallPutFlag=='c': return S*CND(d1)-‐X*exp(-‐r*T)*CND(d2) else: return X*exp(-‐r*T)*CND(-‐d2)-‐S*CND(-‐d1) print '<h2>Black Scholes Pricing Analysis</h2>' sql='''SELECT DATE(NOW()),DATE(NOW()+INTERVAL %s day)'''%Days; db.execute(sql); r=db.fetchall(); StartDate=str(r[0][0]);EndDate=str(r[0][1]); #StartDate=StartDate.replace('-‐',''); EndDate=EndDate.replace('-‐',''); sql='''SELECT Price FROM entities WHERE iid=%s'''%EntityID; db.execute(sql); r=db.fetchone(); 84
CurrPrice=float(r[0]); StrPrice=CurrPrice; sql='''SELECT value FROM volatility WHERE date="%s"'''%StartDate; db.execute(sql); r=db.fetchone(); Vix=float(r[0])*sqrt(365); Vix='%.2f'%Vix; if PlayerID>0: print '''<p> <a href="javascript:history.go(-‐1)">%s</a> > Black Scholes Model'''%Return; print ''' <p style="font-‐family:arial;color:green;font-‐size:12px;"> % </p>''' print '''</table>''' print '''<form action="BSModel.py">''' print '''</td> <table border="6" width="250"> <tr> <th>Underlying Price</th><td style=text-‐align:right>%s</td> </tr> <tr> <th>Strike Price</th><td style=text-‐align:right>%s</td> </tr> <tr> <th>Volatility</th><td style=text-‐align:right>%s</td> </tr> <tr> <th>Days to Expiration</th> <td style=text-‐align:right><input type=text size=11 name="Days" value=%s style=text-‐align:right;></td> </tr> <tr> <th>Risk-‐Free Interest Rate</th> <td style=text-‐align:right><input type=text size=11 name="Rate" value=%s style=text-‐align:right;></td> </tr> <tr> <th rowspan="2">Option Type</th> <td style=text-‐align:right><input type="radio" name="OpType" value="Call">Call Option</td> </tr> <tr> <td style=text-‐align:right><input type="radio" name="OpType" value="Put">Put Option</td> </tr> </table> 85
<input type=submit value="Calculate-‐>>" style=text-‐align:center;font-‐
size:16px> <input type=hidden name=EntityID value="%s"></form> '''%(CurrPrice,StrPrice,Vix,Days,Rate,EntityID); if OpType=="Call": opTitle='Call Option' else: opTitle='Put Option' print '''<table class=fctable><td class=head bgcolor=silver>Stock Price <td class=head bgcolor=silver>%s <tr>'''%(opTitle); StockPrice=[];OptionPrice=[]; if StrPrice>0: StockPrice.append(0.97*StrPrice) for a in StockPrice: if a<1.03*StrPrice: a+=0.005*StrPrice StockPrice.append(a) # print '''<tr><td align=center class=fctable>%.2f'''%(a); oDays=float(Days)/365; oRate=float(Rate)/100; i=0; if OpType=="Call": opflag='c' else: opflag='p' for s in StockPrice: v=blackSholes(opflag,s,StrPrice,oDays,oRate,float(Vix)); OptionPrice.append(v); print '''<tr><td align=center class=fctable>%.2f<td align=center class=fctable>%.4f<tr> '''%(StockPrice[i],OptionPrice[i]); i+=1 tlist=[] j=0 for i in StockPrice: tlist.append([i, OptionPrice[j]]) j+=1 print '''</table>''' print '''<form action="BSModel.py">''' print '''</td> 86
<table border="6" width="250"> <tr> <th>Underlying Price</th><td style=text-‐align:right>%s</td> </tr> <tr> <th>Strike Price</th><td style=text-‐align:right>%s</td> </tr> <tr> <th>Volatility</th><td style=text-‐align:right>%s</td> </tr> <tr> <th>Days to Expiration</th> <td style=text-‐align:right><input type=text size=11 name="Days" value=%s style=text-‐align:right;></td> </tr> <tr> <th>Risk-‐Free Interest Rate</th> <td style=text-‐align:right><input type=text size=11 name="Rate" value=%s style=text-‐align:right;></td> </tr> <tr> <th rowspan="2">Option Type</th> <td style=text-‐align:right><input type="radio" name="OpType" value="Call">Call Option</td> </tr> <tr> <td style=text-‐align:right><input type="radio" name="OpType" value="Put">Put Option</td> </tr> </table> <input type=submit value="Calculate-‐>>" style=text-‐align:center;font-‐
size:16px> <input type=hidden name=EntityID value="%s"></form> '''%(CurrPrice,StrPrice,Vix,Days,Rate,EntityID); #print '''<img border=0 src="jpg.html" alt="Pulpit rock" width="304" height="228" />''' 87
BIBLIOGRAPHY
[1] Berg, J. E., Forsythe, R., Nelson, F. and Rietz, T. A. 2001. “Results from a Dozen
Years of Election Futures Markets Research.” Handbook of Experimental
Economic Results (Plott, C. and Smith, V. L., Eds).
[2] Justin Wolfers and Eric Zitzewitz, 2006. “Five Open Questions About Prediction
Markets.” Information Markets: A New Way of Making Decisions in the Public
and Private Sectors, AEI-Brookings Press, eds: Robert Hahn and Paul Tetlock.
[3] Justin Wolfers and Eric Zitzewitz, 2004. “Prediction Markets.” Journal of
Economic Perspectives, 18(2), pp. 107-126
[4] Justin Wolfers and Eric Zitzewitz, 2005. “”Prediction markets in theory and
practice”. University of Pennsylvania, The Wharton School. Working paper.
[5] Joint, Emile Servan-Schreiber, David Pennock and Brian Galebach, 2004.
“Prediction Markets: Does Money Matter?” Electronic Markets, 14(3)
[6] Joyce Berg, Robert Forsythe, Forrest Nelson and Thomas Ristz, 2000. “Results
from a Dozen Years of Election Futures Markets Research” College of Business
Administration, University of Lowa
[7] Bo Cowgill, Justin Wolfers and Eric Zitzewitz, 2009. “Using Prediction Markets
to Track Information Flows: Evidence from Google.”
[8] Aı¨t-Sahalia, Yacine, Yubo Wang and Francis Yared, 2001. “Do Options Markets
Correctly Price the Probabilities of Movement of the Underlying Asset?” Journal
of Econometrics, 102(1), pp. 67–110
[9] Berg, Joyce and Thomas Rietz, 2003. “Prediction Markets as Decision Support
Systems.” Information Systems Frontiers. 5(1), pp. 79 –93.
[10]
Justin Wolfers and Eric Zitzewitz, 2005. “ Interpreting prediction market
prices as probabilities”. University of Pennsylvania, The Wharton School.
Working paper.
88
[11]
Sesia J. Zhao, Wagner, Christian and Chen Huaping. “Review of prediction
market research: Guideline for information systems research”
[12]
John C. Hull, 2006 “Options, Futures, and Other Derivatives”, Fifth Edtion
[13]
Jérôme Martin, 2006. “Information Aggregation Efficiency in Virtual
Prediction Markets” Business Information Management, RSM Erasmus
University
[14]
Reeves, D.M., Soule, B. M.and Kusturi, T. 2006, ‘Yootopia!’ ACM SIGecom
Exchanges, 6 (2): 1-26.
[15]
Smith, V.1962. “An Experimental Study of Competitive Market Behavior’”
Journal of Political, Economy, 70:111-37.
[16]
Kambil A & van Heck E. “Making markets: How firms design and profit from
online auctions and exchanges. Harvard Business School, Press (2002).
[17]
Nikolay Archak &Panagiotis G. Ipeirotis. ”Modeling Volatility in Prediction
Markets”.Department
of
Information,
Operations,
and
Management
SciencesLeonard N. Stern School of Business, New York University
[18]
Public Prediction Markets Heuristic Review:
http://www.usablemarkets.com/2006/04/27/public-prediction-markets- heuristicreview-introduction-and-methodology/ [19]
Van Bruggen GH, Spann M, Lilien GL & Skiera B.”Institutional forecasting:
the performance of thin virtual stock markets. Erasmus”. Institute of Management
Report Series (2006). Working paper.
https://ep.eur.nl/bitstream/1765/7840/1/ERS-2006-028-MKT.pdf
[20]
Dr. A. A. Kotzé, Financial Chaos Theory, “Stock Price Volatility: a primer”
http://quantonline.co.za/documents/Volatility.pdf
[21]
Technical Analysis
http://www.niftydirect.com/nsebse/market-gyan/Learning%20Session%207th.pdf 89
[22]
Evaluation of Prediction Market V.1 and Experiment Analysis Version:
http://www.laboranova.com/wb/media/download_gallery/D5_2_2_Evaluation_of_
Prediction_Market_V_1_and_Experiment_Analysis.pdf [23]
Christian Slamka, Stefan Luckner and Thomas Seemann. “An empirical
investigation for the pirical investigation of the forecast accuracy of play money
prediction markets and professional betting markets.”
http://is2.lse.ac.uk/asp/aspecis/20080046.pdf 90
© Copyright 2026 Paperzz