Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

medovids

Stock market AI

This topic is 5995 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to make a stock market game but I am not sure how to make the AI for it. When do the prices go up and when do they go down, how much do they go up by or how much do they go dowm by?

Share this post


Link to post
Share on other sites
Advertisement
My recommendation would be to get a book on investment economics, macro-economics, stocks and investments, etc. If you know enough about the subject of you game the AI becomes simple.

Share this post


Link to post
Share on other sites
the stock market is very complex... even the "experts" who invest and talk about it don''t really have a clue. if they did, they''d all be rich and the stick market would lose it''s blackjack appeal (at least as far as i am concerned). so, no matter how deep into the subject you delve, there will still be a big chunk of random thrown in there.

--- krez (krezisback@aol.com)

Share this post


Link to post
Share on other sites
Scientific American had an article a couple of years back related to mandelbrot sets and stock market patterns. Depending on exactly what you want to do with the data, you might be able to generate data using some of these techniques (?)

Share this post


Link to post
Share on other sites
hmm, this is probably off topic, but i recall hearing about a person who used neural nets, or perhaps another type of AI, to analyze the stock market and try to predict what will happen next (in order to make money). from what ive heard (and we should all know about rumors) he did pretty well.

anyway, just a story i heard, i dont even know if its true. lol


 - jeremiah
 http://fakemind.com

Share this post


Link to post
Share on other sites
To sum up, the stock price will change based on what people are willing to pay for it. If people want it, they will be willing to buy it for more than it is currently listed... assuming someone is willing to unload it. If you want to sell, and no one is buying, you may have to sell it for less and the price would then fall. How much? That depends on the who is willing to pay/part with what amount. It''s all an excercise in human psychology and perception. Model it? Woo hoo... that''s a rough one. Feel free to contact me (my email is dead until Wed. 16th) if you would like some more input on this.

Dave Mark
Intrinsic Algorithm Development

Share this post


Link to post
Share on other sites
I suspect we would need to ask the questions...

Are the players going to be involved in buying and selling? If so, how many players? Do you want their transactions to affect the price? Are you going to be creating outside stimuli like economic indicators or company press releases? Those certainly affect the perception of a company''s future and therefore its price. We need more info on what it is you are trying to do.

Dave Mark
Intrinsic Algorithm Development

Share this post


Link to post
Share on other sites
Just thinking aloud:

I wonder how closely the game AI should model the real stock market... In the real world, you worry about real money and the consequences of your actions. This does at least two things.

1. You''re probably much more conservative than you would be in a game. (Even if you''re high risk, you''re probably higher risk in the game)

2. You''re willing to read/study a lot more than you would be willing to in a game. Reading press releases is generally fairly boring. Reading fake press releases would be extremely boring (at least for me).

Having said that, perhaps the AI should be much more wild than real economic theory. Perhaps the dynamics of market activity and price would be completely different if you were aiming for fun vs. reality.

Again, just thinking out loud...

Share this post


Link to post
Share on other sites
quote:
Original post by Torn Space
If you just want the price to move up and down, you can do something like this for each stock:

For every day, roll d100:
0-30: stock starts a downward trend (-1% to -5% per day)
31-70: the trend continues
71-99: stock starts upward trend (+1% to +5% per day)

That''s overly simple, but it''s a good start.


Unfortunately, that would not create stock price movement which mimics the way real stock prices move. Your method would have little chance of creating double bottoms and double tops, or trendlines.

A double bottom is where a price bounces off of a particular price level where the index or stock bounced before, say three weeks ago. Such patterns look like a ''W''. The psychology of the markets create these patterns. Investors see that investors were not willing to let the price drop below a certain price before. They believe that price is a ''fair'' price. They refuse to purchase at a higher price so let it drop. It does, and then the crowd rushes in to buy where it bounced before, creating a self fulfilling bounce.

Trendlines are weird but very common. A stock price advances, and then drops about two thirds of its advance and then advances again to a new high. This will repeat for several times. At each time the price dips and advances again, you can connect these dips with a diagonally advancing straight edge. It is really uncanny.

New highs indicate strength in a stock. When a stock breaks an old high, it has destroyed the psychology of what it was previously thought to be its maximum value. Investors often buy stocks making new highs, because they have ''cleared'' the way for advancement.



___________________________________

Share this post


Link to post
Share on other sites
A familiarity with the internal mechanisms of the markets would go a long way towards setting up a simulation of one. The NASDAQ uses a market maker system. Some reading on NASDAQ market makers will facilitate your understanding of them. The big board (NYSE) uses specialists. Regardless, an understanding of the bid & ask is necessary.

___________________________________

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!