Thread: Stock Program

  1. #1
    Registered User
    Join Date
    Jun 2012
    Posts
    7

    Stock Program

    I want to create a program that


    1 - downloads spreadsheet from yahoo finance.
    2 - Scans prices to see if buy / sell signal is found.
    3 - Alerts me to this fact.


    is this possible can any one let me know any hints

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Well how much C do you know, and how much "must" be done in C ?

    Because something like
    1 - downloads spreadsheet from yahoo finance.
    would be getting on for a thousand lines of code in C (if you don't use a library)

    But if you're open to any kind of mixed approach, then the first step could be as easy as a single command line such as
    wget http://yahoo.com/path/to/spreadsheet.xls
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jun 2012
    Posts
    7
    thats what i planned on starting with i did 2 modules in university on c one finishing with the creation of our own working shell.

    its mainly the other two part that im to sure where to start on.

    i would prefer this being short and sweet

  4. #4
    Registered User
    Join Date
    Dec 2011
    Posts
    51
    Let me see, you created your own working shell, yet you cannot figure out how to search a list of stored values and get a warning if a threshold is met?

  5. #5
    Registered User
    Join Date
    Jun 2012
    Posts
    7
    it was a few yrs back and i havent touched c since tbh

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    OK, let's assume you're using Linux (or at a pinch cygwin on windows) and that you have a shell script with an appropriate wget command in.

    Having got the file, what format is it in?
    If it's a .csv or .txt file, then that's going to be dead easy to deal with.
    If not, then you need to tell us what format it is.


    And how is "alert" going to work?
    - popup on screen
    - email message
    - text message
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  7. #7
    Registered User
    Join Date
    Jun 2012
    Posts
    7
    It will be a csv file.
    and i would be happy with it, just producing a txt file with Buy or Sell but would also be interested in a simple email sent with the same output

    The exact file which i would want to us is:

    http://ichart.finance.yahoo.com/tabl...00&ignore=.csv
    Last edited by Adrian K'Ski; 06-02-2012 at 09:02 AM.

  8. #8
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    I'm confused...are you waiting for someone here to write this for you or what?

  9. #9
    Registered User
    Join Date
    Jun 2012
    Posts
    7
    no im just showing them what im using i just want a few hints

  10. #10
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Hints(1)
    Lookup fopen / fgets / fclose for reading the file
    Lookup sscanf / strtok for extracting data


    Hints(2)
    Use a better text processing language like AWK or Perl.

    That's 2 of your 3 problem steps solved - start putting in some effort.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  11. #11
    Registered User
    Join Date
    Dec 2011
    Posts
    51
    You have to figure out your own strategy. You must have learned that when you programmed your shell, even if it has been a while as you claim. Break your problem down and go one step at a time. If a step seems to big, then break it down further.

  12. #12
    Registered User
    Join Date
    Jun 2012
    Posts
    7
    Thanks for the people that gave nice advice as for the others that didn't back off, im not a programmer.
    im doing a favour for a mate.

  13. #13
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Quote Originally Posted by Adrian K'Ski View Post
    Thanks for the people that gave nice advice as for the others that didn't back off, im not a programmer.
    im doing a favour for a mate.
    Then thanks for wasting everybody time!!!

    This IS NOT a site that writes code per request.

    This is a site that helps programmers and people who wish to be programmers.

    I see no desire on your part to do any work on writing code.

    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  14. #14
    Registered User
    Join Date
    Jun 2012
    Posts
    7
    wasting time, only people that take there time to abuse some one using this site to ask for help.
    the ones they gave constrictive help thanks.

    if you join a thread jsut to abuse me then your not a nice person

  15. #15
    Registered User
    Join Date
    Dec 2011
    Posts
    795
    > if you join a thread jsut to abuse me then your not a nice person
    If you join a forum just to beg for code, you're not a nice person.

    I don't think stahta is abusing you, actually, he's reacting as most regulars here would. After finding out that you don't know how to program, you wasted Salem's time because he recommended specific functions and languages (that have no meaning to you).

    Also, don't try and bull........ us and say what you've written in the past. You clearly didn't "write a shell".

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Stock system
    By dan.goodridge in forum C Programming
    Replies: 7
    Last Post: 05-21-2012, 04:54 AM
  2. C Stock Sorting Program Issue
    By litebread in forum C Programming
    Replies: 18
    Last Post: 12-09-2011, 11:37 PM
  3. Stock Data
    By bskaer1 in forum C++ Programming
    Replies: 0
    Last Post: 10-16-2010, 11:59 PM
  4. Stock market
    By Liger86 in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 05-20-2003, 05:12 PM
  5. Stock Taking program
    By C Babe in forum C++ Programming
    Replies: 3
    Last Post: 05-15-2003, 07:40 PM