Money Market Game
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Money Market Game
I am swamped with work and have very little time to work on FS or QOC.
I do have some spare time so I was gonna make a fun little market type game for IR. Just something to goof with and we can see who can make the most money. Maybe a very simple casino game or stock market game. Nothing special, nothing flashy. I amusing this to learn some more on JS and algorithms.
Suggestions wanted...
I do have some spare time so I was gonna make a fun little market type game for IR. Just something to goof with and we can see who can make the most money. Maybe a very simple casino game or stock market game. Nothing special, nothing flashy. I amusing this to learn some more on JS and algorithms.
Suggestions wanted...
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Money Market Game
How about making it a real market game, and actually use stock ticker web services to track the real value of real stocks?
Each person could get so much virtual money to start, invest it in stocks, and then the value of their stocks could be kept in a database. Then it could just run a cron each day to update with the current value!
Code: Select all
<?php
//set up stock symbol
$symbol = "AMZN";
echo "<h1>Stock quotes for ".$symbol."</h1>";
//open URL to prepare to extract web service data
$url = 'http://finance.yahoo.com/d/quotes.csv'.'?s='.$symbol.'&e=.csv&f=sl1d1t1c10hgv';
if (!($contents = file_get_contents($url))) {
die("Failure to open ".$url);
}
//extract relevant data
list($symbol, $quote, $date, $time) = explode(',', $contents);
$date = trim($date, '"');
$time = trim($time, '"');
//display or process relevant data
echo "<p>$symbol last sold at $quote</p>";
echo "<p>Quote current as of $date at $time</p>";
echo "<p>This information retrieved from<br />$url";
?>The indelible lord of tl;dr
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Money Market Game
that actually sounds fun! I will look into it.
I began working on a just mini game type site where we all start with same money but play games to win more. Named it First to a Million, I could add the real stocks to this.
I was also gonna have lottery every day and lots o mini games
Quick rough draft

I began working on a just mini game type site where we all start with same money but play games to win more. Named it First to a Million, I could add the real stocks to this.
I was also gonna have lottery every day and lots o mini games
Quick rough draft

- SpiritWebb
- Posts: 3107
- Joined: Sun Jul 12, 2009 11:25 pm
Re: Money Market Game
That could make things more interesting!!Jackolantern wrote:How about making it a real market game, and actually use stock ticker web services to track the real value of real stocks?Each person could get so much virtual money to start, invest it in stocks, and then the value of their stocks could be kept in a database. Then it could just run a cron each day to update with the current value!
Code: Select all
<?php //set up stock symbol $symbol = "AMZN"; echo "<h1>Stock quotes for ".$symbol."</h1>"; //open URL to prepare to extract web service data $url = 'http://finance.yahoo.com/d/quotes.csv'.'?s='.$symbol.'&e=.csv&f=sl1d1t1c10hgv'; if (!($contents = file_get_contents($url))) { die("Failure to open ".$url); } //extract relevant data list($symbol, $quote, $date, $time) = explode(',', $contents); $date = trim($date, '"'); $time = trim($time, '"'); //display or process relevant data echo "<p>$symbol last sold at $quote</p>"; echo "<p>Quote current as of $date at $time</p>"; echo "<p>This information retrieved from<br />$url"; ?>
Re: Money Market Game
It'd be better to use fake stocks. Because if you use real stocks you can't effect the market.
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Money Market Game
While that is true, using real stocks adds a much more realistic aspect to picking and choosing stocks. It just depends on how deep the game is desired to be. Using fake stocks would lend itself more to a game that people could pop in once a day and play for a couple of minute before moving on. Using real stocks would lend itself more to players who at least do a bit of market research doing the best.Noctrine wrote:It'd be better to use fake stocks. Because if you use real stocks you can't effect the market.
EDIT: Of course "market research" sounds so boring, but for example, say you hear on a rumor website that Apple is releasing a new gadget, so you go and invest a huge amount in them before it is publicly announced, hoping that the rumor was right. Or you invest in McDonalds after seeing a news article about them re-dressing their stores to look more like cafes (which they did a couple of years ago and it re-invigorated the brand which had been slumping).
The indelible lord of tl;dr
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Money Market Game
i love the idea of using real stocks. Jack can you PM me more details on where you got the above and where I can find all the symbol listings?
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Money Market Game
K found the symbol list, just got to figure out which ones to use and how to gather them all in one deal instead of entering each symbol.
never mind think I figured it out...rock on.
never mind think I figured it out...rock on.
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Money Market Game
Awesome! Do you think you may end up showing the code for the final game? I had some ideas for some stock-related games as well 
The indelible lord of tl;dr
- hallsofvallhalla
- Site Admin
- Posts: 12026
- Joined: Wed Apr 22, 2009 11:29 pm
Re: Money Market Game
i can yes.
I did not figure out how to truly pull all the symbols at once but to be honest I don't know that i want to deal with all the stocks. Will be too many to deal with in the beginning. Was thinking maybe 20 of the ones we know.
Anyone disagree?
I did not figure out how to truly pull all the symbols at once but to be honest I don't know that i want to deal with all the stocks. Will be too many to deal with in the beginning. Was thinking maybe 20 of the ones we know.
Anyone disagree?

