T_Kill3r
13-08-2009, 05:43 PM
ey everyone.
Im currently in grade 11, and i take IT as you'd probably guess. This year for my practical assignment i have decided to create a virtual stock exchange.
Now the thing is, i need some help because i just can't find the logic to reach what im aiming for, and i was hoping for someone who could assist me in establishing this logic, which i wont have a problem converting to code. So my appeal isnt for you guys to give me the code for what im asking, just the framework or logic which i can base it on.
The school uses Delphi by the way.
I'll start by explaining what i have in mind so far.
The game will only make use of 5 companies in which the user can invest. A 1 year history of the share prices of each of the companies will be downloaded and be put into a database. The user will be given a starting amount and he will invest where he/she chooses.
Now, what i had in mind is, the program gets the date off the pc, and uses this date to determine how many days have past since the user last logged on, and then will insert the (random)data up untill this point. Im wondering what the easiest way will be to determine how many days have passed? With months varying from 30 to 31 days, and 28 in february, will the amount of days in each month have to be pre entered and then this used to calculate the days passed? or is there an easier method? And is it possible to work on an hourly basis, for users who dont wish to 'play' at such a slow pace?
Now the second issue im having trouble with is trends. The shares cant just randomly fluctuate because it would pretty much defeat the purpose of share investing and it would just be a matter of luck. What i though would be an easy way, would be to create a random number, and then use this number as the number of days the share will increase or decrease. And in this period of increasing or decreasing, the share will have a greater chance of increasing(or decreasing) until it reaches the end of the 'trend' and another random number is created. This way the share will follow a trend, but can still increase of decrease daily during the trend.
The other idea i had in mind was to calculate the trend of the last month, weak, and day, and after comparing the three, to give a chance of increase or decrease depending on the result. It will have a larger chance to follow the monthly trend, up until a point where the monthly increase/decrease becomes too large, and the chance of following the trend will decrease until the trend reaches equilibrium or shifts in an opposite direction.
I dont know which will work better, and i dont know if there is any other more effective or easier ways to do this.
Any help or suggestions will be greatly appreciated, whether regarding the above mentioned, or just the general idea of the program
Thanks in advance
Im currently in grade 11, and i take IT as you'd probably guess. This year for my practical assignment i have decided to create a virtual stock exchange.
Now the thing is, i need some help because i just can't find the logic to reach what im aiming for, and i was hoping for someone who could assist me in establishing this logic, which i wont have a problem converting to code. So my appeal isnt for you guys to give me the code for what im asking, just the framework or logic which i can base it on.
The school uses Delphi by the way.
I'll start by explaining what i have in mind so far.
The game will only make use of 5 companies in which the user can invest. A 1 year history of the share prices of each of the companies will be downloaded and be put into a database. The user will be given a starting amount and he will invest where he/she chooses.
Now, what i had in mind is, the program gets the date off the pc, and uses this date to determine how many days have past since the user last logged on, and then will insert the (random)data up untill this point. Im wondering what the easiest way will be to determine how many days have passed? With months varying from 30 to 31 days, and 28 in february, will the amount of days in each month have to be pre entered and then this used to calculate the days passed? or is there an easier method? And is it possible to work on an hourly basis, for users who dont wish to 'play' at such a slow pace?
Now the second issue im having trouble with is trends. The shares cant just randomly fluctuate because it would pretty much defeat the purpose of share investing and it would just be a matter of luck. What i though would be an easy way, would be to create a random number, and then use this number as the number of days the share will increase or decrease. And in this period of increasing or decreasing, the share will have a greater chance of increasing(or decreasing) until it reaches the end of the 'trend' and another random number is created. This way the share will follow a trend, but can still increase of decrease daily during the trend.
The other idea i had in mind was to calculate the trend of the last month, weak, and day, and after comparing the three, to give a chance of increase or decrease depending on the result. It will have a larger chance to follow the monthly trend, up until a point where the monthly increase/decrease becomes too large, and the chance of following the trend will decrease until the trend reaches equilibrium or shifts in an opposite direction.
I dont know which will work better, and i dont know if there is any other more effective or easier ways to do this.
Any help or suggestions will be greatly appreciated, whether regarding the above mentioned, or just the general idea of the program
Thanks in advance