S&P500 Visualized in Second Life



Way back in 1996 or so, I was working at a Quantal International, maintaining a database of daily closing equity prices from all over the world. One of my pet projects at the time was exporting the data into VRML to make an interesting perspective on the relationship between stocks. That idea came back to me recently as something that would fit well inside Second Life.
If you visit Clear Ink Island, 100m up in the extreme Southwest corner is a vast field of colored blocks that represent the S&P500. Each block grows or shrinks in height according to the market value. As values go down, the column turns red. As values go up, the column turns green. Blue columns haven't changed in price.
Samples are taken every five minutes from Yahoo! Finance, which provides a CSV feed. Data actually flows from Yahoo to a script on a Clear Ink server and then into Second Life for two reasons. First, Second Life won't accept a document that's not text and Yahoo sends the file through as binary to force browsers to show a Save As... dialog. Secondly, with my own script in between, I can manage a cache to reduce bandwidth to Yahoo!.
Each column is an independent object with its own timer that fetches the latest stock price then animates the time series it keeps. Data goes back two hours. The snapshots in this post don't do the spectacle justice. While the market is open, the field twinkles. When I first built it, it displayed a definite wave of updating blocks but drift in the timers must have scrambling things up after running for a few weeks.
So, this field is 20 x 25 meters. It's not something I wanted to build by hand. I built a master factory object. I first thought I could create and place objects from the master object, but Second Life disallows creating objects more than 10m away from the creating object. So, I programming the master object to create a pillar, move 1m and then create the next column. And since my rows are more then 10m wide, I programming the master object to walk a zig-zag path: down a row, forward 1m and then up the next row.
How useful is this? For managing a portfolio, it's not very useful. I'm sure traders have superior tools. However, it demonstrates a technique we may see more and more as Second Life picks up steam. There is something visceral about flying into a field of colored blocks, almost feeling the differences between prices.
| Attachment | Size |
|---|---|
| sp500_1.jpg | 39.09 KB |
| sp500_2.jpg | 57.68 KB |
| sp500_3.jpg | 57.88 KB |
ironic in an unfunny way