Ask HN: Any material on algorithms for a stock exchange simulation game?

23 points by digamber_kamat ↗ HN
I am trying to build a small stock exchange simulation game (web based). This will be used to train some young students in India on how exactly the whole trading mechanism works.

I was wondering is there are any open-source CMS type system already available in in domain. But more than that I would appreciate if someone can point to me any books/blogs about the stock market simulation experiments.

14 comments

[ 2.8 ms ] story [ 50.9 ms ] thread
Are they actions of buying and selling be the sole driver of the price?
Real stock markets work that way (so we believe) but a simulation engine need not make it work that way main reason is that our initial user-base will be very small and that wont result into major changes in the prices and hence they will get bored pretty soon.
You could use ticker names and quotes from one of the real stock exchanges to start with. This could act as base prices with some changes due to buying/selling in your engine. Till you get lots of users.
I think you could go one of two ways with this:

1. Consume live market data and use an exchange simulator that always gives you back a fill. 2. Use a true exchange simulator, which you will have to seed with orders to provide liquidity and generate real quotes (with a proper spread and not locked or crossed).

With the second approach, you get a more accurate representation of how markets work, but the exercises will have to be more planned out and directed.

Just my $0.02.

In that case, I would consider doing what Matthias did for for his game [1]

  The computer will present you with a random historical
  stock chart of an actual large cap (S&P 500) security,
  without telling you which company and time period the 
  chart represents.
  
  You are then given the opportunity to reveal the stock 
  chart one day at a time, selecting to "buy" or "sell" 
  the stock at various times. After a maximum of one year
  is played for the security, the actual name of the company,
  and what time period the graph was for is revealed...
  
  You are rated on how much profit you made over the days
  you were invested... [compared] to a strategy of "buy and
  hold" on the stock. 

[1] http://chartgame.com/
If one exists, it should use BitCoins as currency. FTW
Bitcoin is fairly predictable.

As something with no value behind it except that which we have attributed to it, all of it's value comes directly from that. With things like oil or stocks, they make profits or they are used some how.

Bitcoin is similar to gold, in that it's worth the demand and the hype.

Consider these two charts (set both to 30 days)

https://www.bitcoinmarket.com/market/charts/

http://www.google.com/trends?q=bitcoin&ctab=0&geo=al...

The value of BC grows when the volume of news grows, the volume of BC trade grows when the volume of BC searches grow.

High volume can sometimes indicate the value of something. Right now, I'm hedging that BC will reach 40 in the next week or sooner. Highly volatile market.

Why are you simulating stock charts? Use real companies. What a company is doing is vitally important to almost everyone except day-traders, and even then it's still kind of important.
Just my opinion, but I think I would consider using historical data, perhaps munged by a coefficient to make it harder for a player to identify the historical basis using a few trades. Market psychology is notoriously finicky and feels like it would be poorly represented by an algorithm to me. This would have the added advantage of simulating some price action based on things like news, earnings, current events etc. I think I would tend to pick gentle bull market period, or perhaps concatenate a couple of cycles to make a bull market->correction->recovery cycle. It all depends on what your goals are of course, but one bonus is that unlimited historical data is all out there and easy to get (so you could pick many periods or even have the computer pick them). A long time ago I participated in a stock market simulation that was run this way, at the end it was revealed what the actual stock basis was for the tickers and it was pretty interesting to be able to go back and look at some of the news around those stocks from the time period.
The search keyword you want is "Santa Fe market simulator".
" how exactly the whole trading mechanism works." <-- different exchanges have different rules and restrictions, even within a country (for example, there are special parity rules in NYSE which violate NASDAQ's "price-time priority" rules). And different countries have different rules, such as the US stock markets with Regulation NMS. Can you be more specific about which exchanges you want to work with?

"point to me any books/blogs" <-- Larry Harris Trading and Exchanges http://tradingandexchanges.com/, a little bit outdated but still my favorite

I'm looking for something simliar. Execpt i want to do something along the lines of Empire Avenue.
If only you could outsource this job to India...