🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Stock market AI

Started by
53 comments, last by medovids 22 years, 5 months ago
THANKS GUYS,

I got some very good answers! Although I think I have some understanding of how a stock market works in real. I wanted to know how do I program the way it works in real and I didn''t really get much help with that.(Allthough a few suggestions were very interesting!)
Advertisement
quote: Original post by medovids
I wanted to know how do I program the way it works in real and I didn''t really get much help with that.(Allthough a few suggestions were very interesting!)


Well, isn''t understanding the mechanisms of the market, the motivations of its participants, and the appearance of the market 90% of your battle?



___________________________________

_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
Well yes, but I still need the other 10%.I want to find a simple yet effective way of doing this!
quote: Original post by Anonymous Poster
With that in mind, do you have a non-hostile response to my argument? I''d really love for someone to prove me wrong, since I would then have access to a system better than the buy-and-hold and index fund strategies I currently use.

I''m just trying to figure out how your opinion that the stock market is not unlike a random number generator will help the poor chap who is asking the question.


Dave Mark
Intrinsic Algorithm Development

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

quote: Original post by medovids
Well yes, but I still need the other 10%.I want to find a simple yet effective way of doing this!

THAT you won''t find. At the very least, you would need to simulate hundreds if not hundreds of THOUSANDS of individual perceptions and personalities... for THAT is what moves the market.


Dave Mark
Intrinsic Algorithm Development

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

Thanks,

But how would I generate so many dif. personalities?

Edited by - medovids on January 15, 2002 11:11:21 PM
Some ramblings pretty much off of the top of my head here...

What if we view the stock market as the PERCEIVED value of the company offering the stock rather than the actual value. Then we must realise that certain outside forces are going to affect the stock prices. I think what you want to do is model these forces. Keeping it quite simple group stocks in certin categories that are affected one way or another by a given event.

Taking it further, each stock has a list of event categories and weights. Each event has its own list of categories it affects, the base magnitude of its affect, and a (potentially infinate duration).

Every 'day' that an event is active it affects related stocks

For Example:

STOCKS:


Nanooks Boutique $100.00/share
--------------------
Winter 5.0
Summer -5.0
Fur 5.0

Bikini Betty's $10.00/share
---------------------
Summer 5.0
Winter -6.0

Freds Meats $50.00
----------------------------
Spring 5.0
Summer 3.0
Fall 5.0
Winter -5
Meat 10.0

Granny's Grains $50.00
----------------------
Fall 10
Summer 7
Winter -3
Spring 1
Storm -15
Meat -5

EVENTS:
Summer affects: Summer (1) for 90 days
Winter affects: Winter (1) for 90 days
Animal shortage affects: fur (-5) for 200 days, meat (-3) 200 days

IN ACTION:
Summer day 1:
-------------------
Nanooks stock drops 1 (summer magnitude) * -5.0 (summer weight) cents to $99.95
Bettys rises to 1 (summer magnitude) * 5.0 (summer weight) cents to $10.05
Fred goes up 3 to $50.03
Granny goes up 7 to $50.07

Summer day 2, animal shortage day 1:
------------------------------------
Poor Nanook gets hammered summer -5, fur -15 = -20 cents = 99.75
Betty enjoys the summer +5 cents = $10.10
Fred starts to take a hit meat -30 + summer + 3 = -27 cents to $49.76
Granny starts to rake it in meat +15 Summer + 7 = +22 cents = $50.29

etc.
-----------

Balance the numbers out realistically and this could work. I originally mad an example of different modes of transportation (coach, rail, car, plane) with factors like steam power, iron, steel, mass production, oil, coal, etc. but it got too coplex for a quick "off of the top of my head idea", but it's workable.

The biggest flaw off the top of my head is that companies with more stocks are affected much more. It may be much better to calculate the net worth of the company have that affected by the events and then divide the total by the number of shares...

Anyway, that's my quick answer.

EDIT: also, a small random factor may be a good idea - but may not be needed, depending on how many categories each stock depends on.

Edited by - Peeper on January 15, 2002 11:29:25 PM
As mentioned above, a stock is always priced at its perceived value. Perceptions change, and stock prices change.

Before a quarterly earnings report, speculation either bids the stock up in anticipation of good earnings, or bids the stock down in anticipation of bad earnings. If a stock rises dramatically before earnings, it may still drop sharply after the earnings report even if the earnings met or beat expectations! This is because the good news was already factored into the price, and then some.

Anticipation of news drives a stock price. Barring truly unexpected events (September 11th?), stocks generally move in waves or cycles in anticipation of cyclical events such as earnings reports, seasonal retail and service environments, elections, monthly government released statistics, etc.

Large companies trade in high volume, cerating liquidity in the market, and theoretically a more informed price. Such stocks exhibit better waves and cycles as the machinations of the economy drive it up or down. Extremely small companies (penny stocks) have little liquidity and languish until a big block trades, at which point it spikes to a new level.

In addition to anticipation of news items, stocks play against their past history due to market psychology. Prior strategic price levels where the stock bounced or failed to make a new high are major psychological baggage and heavily influence investors and traders. Self fulfilling bounces, breakouts, trendlines, etc. work to create their own chart patterns.

___________________________________

_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
Now we are getting somewhere!

Dave Mark
Intrinsic Algorithm Development

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

quote: Original post by InnocuousFox
Original post by Anonymous Poster
With that in mind, do you have a non-hostile response to my argument? I''d really love for someone to prove me wrong, since I would then have access to a system better than the buy-and-hold and index fund strategies I currently use.

I''m just trying to figure out how your opinion that the stock market is not unlike a random number generator will help the poor chap who is asking the question.


Dave Mark
Intrinsic Algorithm Development

Hmm? Seems pretty obvious to me, but then I was writing it. If the stock market acts liks a random number generator to all appearances, then a good way to simulate it will be by moving the previous day''s stock prices by some small random percentage up or down. You slightly bias your random numbers toward moving upward, and you''ll produce a decent approximation of the stock market.

Of course, this presupposes that you want to model the stock market accurately, and realism may not strictly be the best choice for a stock market game, as opposed to a stock market simulator.

This topic is closed to new replies.

Advertisement