Thread: Relatively simple stock trading "game"

  1. #1
    Registered User
    Join Date
    May 2002
    Posts
    51

    Relatively simple stock trading "game"

    I had the idea of making a simple stock market trainer for daytrading. The idea is you see a random day-graph "unrolling" at a predefined pace. So the program has a database of historical daily graphs (in png picture format) of some stock and the player has a buy and a sell button. The goal is then to make as much money per day as possible.

    I would like to use png pictures (or bmp if i convert them first) because i know where to get them. You have to pay for detailed historical price data and I'm not willing to do that. Also the program would have to read values from the pictures, here's a sample:

    http://i37.tinypic.com/2ebzxpw.png

    Im thinking it shouldnt be impossible to read values from it. The data is always the black line, so I have to remove the thin black frame in all pictures. Then do something like "if pixel = black" then read value. The numbers on the y-axis could probably also be read, converting the pixel-patterns into numbers. However I don't know how to do all this. I would need some picture library which handles bmp or png pics. Something which could read the color of individual pixels and "roll a blanket" off the graphs, which would involve displaying a picture over an existing one or simply making temporary pictures for each clock tick and showing these one by one. Heres also a sample of how i think the program would work:

    http://i39.tinypic.com/29giw7l.jpg
    I abuse:

    Borland C++ Builder 6 Enterprise Edition

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    And the web-site you are getting the .PNG images from do not mind that you are doing that? Just because the site is free to the public doesn't mean that you can take the images from it and use them as you like, you know?

    As to analyzing the images, if we assume that the font is always the same, it wouldn't be particularly hard to analyze that sort of information.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    May 2002
    Posts
    51
    Quote Originally Posted by matsp View Post
    And the web-site you are getting the .PNG images from do not mind that you are doing that? Just because the site is free to the public doesn't mean that you can take the images from it and use them as you like, you know?

    As to analyzing the images, if we assume that the font is always the same, it wouldn't be particularly hard to analyze that sort of information.

    --
    Mats
    Yes I'll have to e-mail them about that. The font stays the same, do you have any suggestions on libraries to use?

    edit: found the pngwriter library. Is it good enough or are there better ones? Think I'll check it out first though and come here complaining when i have problems :P
    Last edited by finnepower; 01-27-2009 at 06:03 PM.
    I abuse:

    Borland C++ Builder 6 Enterprise Edition

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Sorry, have no suggestion for libraries to read PNG. But if we assume the font is the same, then you should be able to just have 10 bitmap segments, for the digits 0 .. 9, that when you find the digits on the side of the graph, you can determine the value from the 10 possible digits - you may need a couple of extra symbols (, and . for example).

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Registered User
    Join Date
    Feb 2009
    Posts
    1
    I found this Stock Trading Game the looks pretty much like what you want to do. It has a daily competition for trading like your trying to build. Maybe it could give you some ideas for your stock trading tool.

  6. #6
    Registered User guesst's Avatar
    Join Date
    Feb 2008
    Location
    Lehi, UT
    Posts
    179
    Heh, I've always wanted to do something more like this:

    http://www.atariarchives.org/basicga...e.php?page=154
    http://www.atariarchives.org/basicga...e.php?page=155
    http://www.atariarchives.org/basicga...e.php?page=156

    That's kinda the direction I thought you might be going with this.
    Type-ins are back! Visit Cymon's Games at http://www.cymonsgames.com for a new game every week!

  7. #7
    Registered User
    Join Date
    Apr 2008
    Posts
    890
    Wow - Mr. Madoff got a computer in prison?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  2. Simple simple program
    By Ryback in forum C++ Programming
    Replies: 10
    Last Post: 09-09-2004, 05:48 AM
  3. Help me with these simple programs
    By Help me in forum C Programming
    Replies: 4
    Last Post: 11-08-2001, 10:38 AM
  4. Need help with simple data types
    By partnole in forum C++ Programming
    Replies: 1
    Last Post: 10-03-2001, 08:36 AM
  5. Linker errors with simple static library
    By Dang in forum Windows Programming
    Replies: 5
    Last Post: 09-08-2001, 09:38 AM