tags:

views:

524

answers:

4

Hey all,

I'm trying to build my own prediction market, and I'm thinking about algorithms. That is to say, how to adjust the price of a contract based on the amount of call and put orders. The basic algorithm I am using now is of two kinds:

For yes/no events (i.e., either the events happens or doesn't) I am just taking the percentage of people who say it will happen, and make that the contract price. If 90% say it will happen, the price in $90 (fake money). The contracts cash out at $100 if the event occurs, $0 is it doesn't.

For events that have a certain value (let's say a athlete's "power rating"), I set an IPO (my guess as to where the thing will cash out) and the apply a percentage increase to the IPO. So if there are 80% more calls than puts then I add 80% to the IPO. I add a little stabilizer so that the early orders don't cause huge jumps (i.e, the first order doubling the price).

Bear in mind this isn't a real market, the players don't trade contracts, they just make call or put orders against the system.

The first thought I had was that I should weigh the more recent calls and puts as they have nore relevant information presumably (like say the athlete just broke his foot). These guys would know more than the guy who bought a contract three months ago.

Any other ideas?

+2  A: 

Option pricing is well studied. Have you read about Black-Scholes and Binomial models? This will help you determine the way price moves up/down in a perfect market.

There are then different type of options -- the vanilla Call/Put (American/European), exotic options, option chains etc. Which ones do you plan to include?

From your description in the last few paragraphs, it looks like you are trying to replicate a Market Maker model of trading. You may want to read up on actual market models (including the one mentioned in the previous statement) before diving in.

dirkgently
I'm just getting started, so calls and puts is what I'm starting with. I may have to bring in someone with deeper math ability than I have.
cerhart
BS/Binomial isn't really difficult. Also, there are variations of the above to take into account various factors. I suggest have a look at these first.
dirkgently
I found a Code Project example of Black-Scholes algorithm. I'll use that to get started. Thanks!
cerhart
Note it is only a theoretical formula. Please also read about how volume/Open Interest affects derivatives in general.
dirkgently
A: 

There are two aspects that it seems you are asking about:

  1. Being a market maker for anything (stocks, bonds, options, bets)
  2. The maths behind replicating any sort of derivative

Both are huge topics...

For the 1st, I recommend the book "Trading and Exchanges" by Larry Harris. http://tradingandexchanges.com/

For the 2nd, Paul Wilmott's book http://www.amazon.co.uk/Paul-Wilmott-introduces-Quantitative-Finance/dp/0471498629

Paul Hollingsworth
Actually, I am building a fake money prediction market along the lines of the Hollywood Stock Exchange, so it just has to "feel right" to the players. i.e., fair and not too weird.
cerhart
+1  A: 

I'm currently reading "Market Microstructure Theory" by Margaret o'Hara. It's a dense book, but provides a good overview of (relatively) recent theoretical studies on how market prices are set.

The first though I had was that I should weigh the more recent calls and puts as they have nore relevant information presumably (like say the athlete just broke his foot). This guys would know more than the guy who bought a contract three months ago.

I don't think you should do this. The trader who knows that the athelete has just broken his foot is an "informed trader", and will use this information to buy/sell a position - if there are no limits on the amount he can trade, then he should trade an infinite amount. Doing a simple average of trades therefore gives you the "correct" price.

endian
Well, he will have a limited amount of "virtual money" to play with, so he can't all by himself bid the price where it needs to be. I guess the answer is to put enough liquidity into the market, which may be why HSX starts you out with 2 million.
cerhart
However, they also limit the number of shares you can hold of any one "stock" so that no one can influence the market simply through bidding the price up or shorting it down.
cerhart
A: 

Why do you need to set a price at all? Just allow people to place puts and calls at any price they wish. If you want to show a 'current' price for reference, take the price of the last transaction, or average the last few transactions.

To get shares into the market in the first place, you can offer 'baskets'. For $100, sell anyone one share of every possible outcome. They can then sell off the outcomes they don't think will happen. You can even take advantage of market inefficiency by automatically generating and selling baskets any time there are buy orders for each outcome totalling more than $100, or you can leave that to enterprising players.

Nick Johnson
That is (implicitly) how foresight exchange works.
Captain Segfault